2019-07-16 20:19:11 -06:00
|
|
|
project(remotefortressreader)
|
2016-11-08 02:41:27 -07:00
|
|
|
# A list of source files
|
2019-07-16 20:19:11 -06:00
|
|
|
set(PROJECT_SRCS
|
2016-11-08 02:41:27 -07:00
|
|
|
remotefortressreader.cpp
|
2017-12-24 06:03:25 -07:00
|
|
|
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
|
2016-11-08 02:41:27 -07:00
|
|
|
)
|
|
|
|
# A list of headers
|
2019-07-16 20:19:11 -06:00
|
|
|
set(PROJECT_HDRS
|
2017-12-24 06:03:25 -07:00
|
|
|
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
|
2017-06-20 04:16:03 -06:00
|
|
|
df_version_int.h
|
2016-11-08 02:41:27 -07:00
|
|
|
)
|
2019-07-16 20:19:11 -06:00
|
|
|
# proto files to include.
|
|
|
|
set(PROJECT_PROTO
|
2019-04-18 20:48:36 -06:00
|
|
|
RemoteFortressReader
|
|
|
|
AdventureControl
|
|
|
|
ItemdefInstrument
|
|
|
|
DwarfControl
|
|
|
|
ui_sidebar_mode
|
2016-11-08 02:41:27 -07:00
|
|
|
)
|
|
|
|
|
2019-07-20 17:19:40 -06:00
|
|
|
set(PLUGIN_PROTOS)
|
|
|
|
foreach(pbuf ${PROJECT_PROTO})
|
|
|
|
list(APPEND PLUGIN_PROTOS ${CMAKE_CURRENT_SOURCE_DIR}/../proto/${pbuf}.proto)
|
|
|
|
endforeach()
|
2019-04-18 20:48:36 -06:00
|
|
|
|
2019-07-20 17:19:40 -06:00
|
|
|
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)
|
2019-04-18 20:48:36 -06:00
|
|
|
|
2019-07-20 17:19:40 -06:00
|
|
|
set_source_files_properties( ${PROJECT_HDRS} ${PLUGIN_PROTO_HDRS} PROPERTIES HEADER_FILE_ONLY TRUE)
|
2016-11-08 02:41:27 -07:00
|
|
|
|
|
|
|
# mash them together (headers are marked as headers and nothing will try to compile them)
|
2019-07-20 17:19:40 -06:00
|
|
|
list(APPEND PROJECT_SRCS ${PROJECT_HDRS} ${PLUGIN_PROTOS} ${PLUGIN_PROTO_SRCS} ${PLUGIN_PROTO_HDRS})
|
2016-11-08 02:41:27 -07:00
|
|
|
|
2019-07-16 20:19:11 -06:00
|
|
|
if(UNIX AND NOT APPLE)
|
|
|
|
set(PROJECT_LIBS ${PROJECT_LIBS} SDL)
|
|
|
|
endif()
|
2018-05-13 23:12:22 -06:00
|
|
|
|
2016-11-08 02:41:27 -07:00
|
|
|
# this makes sure all the stuff is put in proper places and linked to dfhack
|
2022-12-07 12:59:48 -07: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" )
|