summaryrefslogtreecommitdiff
path: root/plugins/CMakeLists.txt
diff options
context:
space:
mode:
authorAlexander Gavrilov2012-03-15 13:01:23 +0400
committerAlexander Gavrilov2012-03-15 13:01:23 +0400
commit87f925e72e7c6f923a595cc930728483a3f1422e (patch)
tree4da81e9346e9f21599cea8c7a2d95d8da4628e2e /plugins/CMakeLists.txt
parente7851f5abdd1a84d29020f2789efc0f932284bf0 (diff)
downloaddfhack-87f925e72e7c6f923a595cc930728483a3f1422e.tar.gz
dfhack-87f925e72e7c6f923a595cc930728483a3f1422e.tar.bz2
dfhack-87f925e72e7c6f923a595cc930728483a3f1422e.tar.xz
Add support for exporting functions from plugins, with example in rename.
TODO: test by actually calling them remotely.
Diffstat (limited to 'plugins/CMakeLists.txt')
-rw-r--r--plugins/CMakeLists.txt17
1 files changed, 16 insertions, 1 deletions
diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt
index aba5feaa..fe00fbaf 100644
--- a/plugins/CMakeLists.txt
+++ b/plugins/CMakeLists.txt
@@ -45,6 +45,21 @@ if (BUILD_DWARFEXPORT)
add_subdirectory (dwarfexport)
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}")
+
+ADD_CUSTOM_COMMAND(
+ OUTPUT ${PROJECT_PROTO_SRCS} ${PROJECT_PROTO_HDRS}
+ COMMAND protoc-bin -I=${dfhack_SOURCE_DIR}/proto/ -I=${CMAKE_CURRENT_SOURCE_DIR}/proto/
+ --cpp_out=${CMAKE_CURRENT_SOURCE_DIR}/proto/
+ ${PROJECT_PROTOS}
+ DEPENDS protoc-bin ${PROJECT_PROTOS}
+)
+
+# Plugins
OPTION(BUILD_SUPPORTED "Build the supported plugins (reveal, probe, etc.)." ON)
if (BUILD_SUPPORTED)
DFHACK_PLUGIN(reveal reveal.cpp)
@@ -70,7 +85,7 @@ if (BUILD_SUPPORTED)
DFHACK_PLUGIN(seedwatch seedwatch.cpp)
DFHACK_PLUGIN(initflags initflags.cpp)
DFHACK_PLUGIN(stockpiles stockpiles.cpp)
- DFHACK_PLUGIN(rename rename.cpp)
+ DFHACK_PLUGIN(rename rename.cpp PROTOBUFS rename)
DFHACK_PLUGIN(jobutils jobutils.cpp)
DFHACK_PLUGIN(workflow workflow.cpp)
DFHACK_PLUGIN(showmood showmood.cpp)