|
|
|
@ -65,7 +65,7 @@ MACRO(DFHACK_PLUGIN)
|
|
|
|
|
)
|
|
|
|
|
CAR(PLUGIN_NAME ${PLUGIN_DEFAULT_ARGS})
|
|
|
|
|
CDR(PLUGIN_SOURCES ${PLUGIN_DEFAULT_ARGS})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SET(PLUGIN_PROTOCPP)
|
|
|
|
|
FOREACH(pbuf ${PLUGIN_PROTOBUFS})
|
|
|
|
|
SET(PLUGIN_SOURCES ${PLUGIN_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/proto/${pbuf}.pb.cc)
|
|
|
|
@ -77,20 +77,22 @@ MACRO(DFHACK_PLUGIN)
|
|
|
|
|
|
|
|
|
|
ADD_LIBRARY(${PLUGIN_NAME} MODULE ${PLUGIN_SOURCES})
|
|
|
|
|
IDE_FOLDER(${PLUGIN_NAME} "Plugins")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ADD_DEPENDENCIES(${PLUGIN_NAME} dfhack-version)
|
|
|
|
|
|
|
|
|
|
# Make sure the source is generated before the executable builds.
|
|
|
|
|
ADD_DEPENDENCIES(${PLUGIN_NAME} generate_proto)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LIST(LENGTH PLUGIN_PROTOBUFS NUM_PROTO)
|
|
|
|
|
IF(NUM_PROTO)
|
|
|
|
|
TARGET_LINK_LIBRARIES(${PLUGIN_NAME} dfhack protobuf-lite ${PLUGIN_LINK_LIBRARIES})
|
|
|
|
|
TARGET_LINK_LIBRARIES(${PLUGIN_NAME} dfhack protobuf-lite dfhack-version ${PLUGIN_LINK_LIBRARIES})
|
|
|
|
|
IF(UNIX)
|
|
|
|
|
SET_TARGET_PROPERTIES(${PLUGIN_NAME} PROPERTIES COMPILE_FLAGS "-include Export.h")
|
|
|
|
|
ELSE()
|
|
|
|
|
SET_TARGET_PROPERTIES(${PLUGIN_NAME} PROPERTIES COMPILE_FLAGS "/FI\"Export.h\"")
|
|
|
|
|
ENDIF()
|
|
|
|
|
ELSE()
|
|
|
|
|
TARGET_LINK_LIBRARIES(${PLUGIN_NAME} dfhack ${PLUGIN_LINK_LIBRARIES})
|
|
|
|
|
TARGET_LINK_LIBRARIES(${PLUGIN_NAME} dfhack dfhack-version ${PLUGIN_LINK_LIBRARIES})
|
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
IF(APPLE)
|
|
|
|
@ -104,4 +106,4 @@ MACRO(DFHACK_PLUGIN)
|
|
|
|
|
install(TARGETS ${PLUGIN_NAME}
|
|
|
|
|
LIBRARY DESTINATION ${DFHACK_PLUGIN_DESTINATION}
|
|
|
|
|
RUNTIME DESTINATION ${DFHACK_PLUGIN_DESTINATION})
|
|
|
|
|
ENDMACRO(DFHACK_PLUGIN)
|
|
|
|
|
ENDMACRO(DFHACK_PLUGIN)
|
|
|
|
|