dfhack/plugins/remotefortressreader/CMakeLists.txt

47 lines
1.5 KiB
CMake

PROJECT (remotefortressreader)
# A list of source files
SET(PROJECT_SRCS
remotefortressreader.cpp
adventure_control.cpp
2017-03-25 10:53:40 -06:00
building_reader.cpp
2018-12-25 23:05:17 -07:00
dwarf_control.cpp
2018-01-17 06:40:19 -07:00
item_reader.cpp
)
# A list of headers
SET(PROJECT_HDRS
adventure_control.h
2017-03-25 10:53:40 -06:00
building_reader.h
2018-12-25 23:05:17 -07:00
dwarf_control.h
2018-01-17 06:40:19 -07:00
item_reader.h
df_version_int.h
)
#proto files to include.
SET(PROJECT_PROTO
RemoteFortressReader
AdventureControl
ItemdefInstrument
DwarfControl
ui_sidebar_mode
)
SET(PLUGIN_PROTOS)
FOREACH(pbuf ${PROJECT_PROTO})
LIST(APPEND PLUGIN_PROTOS ${CMAKE_CURRENT_SOURCE_DIR}/../proto/${pbuf}.proto)
ENDFOREACH()
STRING(REPLACE ".proto" ".pb.cc" PLUGIN_PROTO_SRCS "${PLUGIN_PROTOS}")
STRING(REPLACE ".proto" ".pb.h" PLUGIN_PROTO_HDRS "${PLUGIN_PROTOS}")
SET_SOURCE_FILES_PROPERTIES(${PLUGIN_PROTO_SRCS} ${PLUGIN_PROTO_HDRS} PROPERTIES GENERATED TRUE)
SET_SOURCE_FILES_PROPERTIES( ${PROJECT_HDRS} ${PLUGIN_PROTO_HDRS} PROPERTIES HEADER_FILE_ONLY TRUE)
# mash them together (headers are marked as headers and nothing will try to compile them)
LIST(APPEND PROJECT_SRCS ${PROJECT_HDRS} ${PLUGIN_PROTOS} ${PLUGIN_PROTO_SRCS} ${PLUGIN_PROTO_HDRS})
IF(UNIX AND NOT APPLE)
SET(PROJECT_LIBS ${PROJECT_LIBS} SDL)
ENDIF()
# this makes sure all the stuff is put in proper places and linked to dfhack
2018-04-06 20:22:48 -06:00
DFHACK_PLUGIN(RemoteFortressReader ${PROJECT_SRCS} LINK_LIBRARIES protobuf-lite ${PROJECT_LIBS} COMPILE_FLAGS_MSVC "/FI\"Export.h\"" COMPILE_FLAGS_GCC "-include Export.h -Wno-misleading-indentation" )