2011-06-19 20:29:38 -06:00
|
|
|
#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()
|
2011-06-22 10:04:22 -06:00
|
|
|
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})
|
2011-06-19 20:29:38 -06:00
|
|
|
ENDMACRO()
|
|
|
|
|
|
|
|
DFHACK_PLUGIN(reveal reveal.cpp)
|
2011-07-11 16:07:59 -06:00
|
|
|
OPTION(BUILD_KITTENS "Build the kittens plugin." OFF)
|
|
|
|
if(BUILD_KITTENS)
|
|
|
|
DFHACK_PLUGIN(kittens kittens.cpp)
|
|
|
|
endif()
|
2011-06-19 21:08:21 -06:00
|
|
|
DFHACK_PLUGIN(prospector prospector.cpp)
|
2011-07-07 01:49:58 -06:00
|
|
|
DFHACK_PLUGIN(cleanmap cleanmap.cpp)
|
2011-07-07 02:57:57 -06:00
|
|
|
DFHACK_PLUGIN(weather weather.cpp)
|
2011-07-10 13:07:14 -06:00
|
|
|
DFHACK_PLUGIN(vdig vdig.cpp)
|
2011-07-13 00:17:51 -06:00
|
|
|
DFHACK_PLUGIN(colonies colonies.cpp)
|
2011-07-14 00:52:06 -06:00
|
|
|
|
|
|
|
IF(UNIX)
|
|
|
|
OPTION(BUILD_KILL_GAME "Build the kill gmae plugin." OFF)
|
|
|
|
if(BUILD_KILL_GAME)
|
|
|
|
DFHACK_PLUGIN(die die.cpp)
|
|
|
|
endif()
|
|
|
|
endif()
|