summaryrefslogtreecommitdiff
path: root/library/CMakeLists.txt
diff options
context:
space:
mode:
authorAlexander Gavrilov2012-03-09 21:42:22 +0400
committerAlexander Gavrilov2012-03-09 21:42:22 +0400
commit75c569b09773c0d7644d54fd77350e6ff1073475 (patch)
tree98e5b2e7b2cbe9c60435be0921c8b06e20e1184f /library/CMakeLists.txt
parentedf77cf270e3ff7c4a08cd85fcaf537b254f6273 (diff)
downloaddfhack-75c569b09773c0d7644d54fd77350e6ff1073475.tar.gz
dfhack-75c569b09773c0d7644d54fd77350e6ff1073475.tar.bz2
dfhack-75c569b09773c0d7644d54fd77350e6ff1073475.tar.xz
Add some experimental message definitions to the main library.
Diffstat (limited to 'library/CMakeLists.txt')
-rw-r--r--library/CMakeLists.txt26
1 files changed, 26 insertions, 0 deletions
diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt
index ca4c9d47..e310268a 100644
--- a/library/CMakeLists.txt
+++ b/library/CMakeLists.txt
@@ -141,6 +141,26 @@ ELSE()
LIST(APPEND PROJECT_SRCS ${PROJECT_SRCS_WINDOWS})
ENDIF()
+# Protobuf
+
+FILE(GLOB PROJECT_PROTOS ${CMAKE_CURRENT_SOURCE_DIR}/proto/*.proto)
+
+STRING(REPLACE ".proto" ".pb.cc" PROJECT_PROTO_SRCS ${PROJECT_PROTOS})
+STRING(REPLACE ".proto" ".pb.h" PROJECT_PROTO_HDRS ${PROJECT_PROTOS})
+
+LIST(APPEND PROJECT_HDRS ${PROJECT_PROTO_HDRS})
+LIST(APPEND PROJECT_SRCS ${PROJECT_PROTO_SRCS})
+
+ADD_CUSTOM_COMMAND(
+ OUTPUT ${PROJECT_PROTO_SRCS} ${PROJECT_PROTO_HDRS}
+ COMMAND protoc-bin -I=${CMAKE_CURRENT_SOURCE_DIR}/proto/
+ --cpp_out=dllexport_decl=DFHACK_EXPORT:${CMAKE_CURRENT_SOURCE_DIR}/proto/
+ ${PROJECT_PROTOS}
+ DEPENDS protoc-bin ${PROJECT_PROTOS}
+)
+
+#
+
SET_SOURCE_FILES_PROPERTIES( ${PROJECT_HDRS} PROPERTIES HEADER_FILE_ONLY TRUE )
LIST(APPEND PROJECT_SRCS ${PROJECT_HDRS})
@@ -193,6 +213,12 @@ else()
ENDIF()
endif()
+IF(WIN32)
+ SET_TARGET_PROPERTIES(dfhack PROPERTIES COMPILE_FLAGS "/FI\"Export.h\"" )
+ELSE()
+ SET_TARGET_PROPERTIES(dfhack PROPERTIES COMPILE_FLAGS "-include Export.h" )
+ENDIF()
+
#effectively disables debug builds...
SET_TARGET_PROPERTIES(dfhack PROPERTIES DEBUG_POSTFIX "-debug" )