|
|
|
@ -66,13 +66,21 @@ 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)
|
|
|
|
|
SET(PLUGIN_PROTOCPP ${PLUGIN_PROTOCPP} ${CMAKE_CURRENT_SOURCE_DIR}/proto/${pbuf}.pb.cc)
|
|
|
|
|
ENDFOREACH()
|
|
|
|
|
|
|
|
|
|
# Tell CMake the source won't be available until build time.
|
|
|
|
|
SET_SOURCE_FILES_PROPERTIES(${PLUGIN_PROTOCPP} PROPERTIES GENERATED 1)
|
|
|
|
|
|
|
|
|
|
ADD_LIBRARY(${PLUGIN_NAME} MODULE ${PLUGIN_SOURCES})
|
|
|
|
|
IDE_FOLDER(${PLUGIN_NAME} "Plugins")
|
|
|
|
|
|
|
|
|
|
# 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})
|
|
|
|
|