44 lines
1.6 KiB
CMake
44 lines
1.6 KiB
CMake
#FIXME: inherit all macros and stuff from the dfhack SDK
|
|
IF(UNIX)
|
|
add_definitions(-DLINUX_BUILD)
|
|
SET(CMAKE_CXX_FLAGS_DEBUG "-g -Wall")
|
|
SET(CMAKE_CXX_FLAGS "-fvisibility=hidden -m32")
|
|
SET(CMAKE_C_FLAGS "-fvisibility=hidden -m32")
|
|
ENDIF()
|
|
|
|
include_directories("${dfhack_SOURCE_DIR}/library/include")
|
|
|
|
MACRO(DFHACK_PLUGIN PLUGIN_NAME PLUGIN_SOURCES)
|
|
ADD_LIBRARY(${PLUGIN_NAME} MODULE ${PLUGIN_SOURCES})
|
|
TARGET_LINK_LIBRARIES(${PLUGIN_NAME} dfhack)
|
|
IF(UNIX)
|
|
SET_TARGET_PROPERTIES(${PLUGIN_NAME} PROPERTIES SUFFIX .plug.so PREFIX "")
|
|
ELSE()
|
|
SET_TARGET_PROPERTIES(${PLUGIN_NAME} PROPERTIES SUFFIX .plug.dll)
|
|
ENDIF()
|
|
SET_TARGET_PROPERTIES(${PLUGIN_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY_RELEASE ${DFHACK_PLUGIN_OUTPUT_DIR})
|
|
SET_TARGET_PROPERTIES(${PLUGIN_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY_MINSIZEREL ${DFHACK_PLUGIN_OUTPUT_DIR})
|
|
SET_TARGET_PROPERTIES(${PLUGIN_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY_RELWITHDEBINFO ${DFHACK_PLUGIN_OUTPUT_DIR})
|
|
install(TARGETS ${PLUGIN_NAME}
|
|
LIBRARY DESTINATION ${DFHACK_PLUGIN_DESTINATION}
|
|
RUNTIME DESTINATION ${DFHACK_PLUGIN_DESTINATION})
|
|
ENDMACRO()
|
|
|
|
DFHACK_PLUGIN(reveal reveal.cpp)
|
|
OPTION(BUILD_KITTENS "Build the kittens plugin." OFF)
|
|
if(BUILD_KITTENS)
|
|
DFHACK_PLUGIN(kittens kittens.cpp)
|
|
endif()
|
|
DFHACK_PLUGIN(prospector prospector.cpp)
|
|
DFHACK_PLUGIN(cleanmap cleanmap.cpp)
|
|
DFHACK_PLUGIN(weather weather.cpp)
|
|
DFHACK_PLUGIN(vdig vdig.cpp)
|
|
DFHACK_PLUGIN(colonies colonies.cpp)
|
|
|
|
IF(UNIX)
|
|
OPTION(BUILD_KILL_GAME "Build the kill gmae plugin." OFF)
|
|
if(BUILD_KILL_GAME)
|
|
DFHACK_PLUGIN(die die.cpp)
|
|
endif()
|
|
endif()
|