@@ -22,45 +22,16 @@ if(INSTALL_DATA_FILES)
2222 FILES_MATCHING PATTERN "*.diff" )
2323endif ()
2424
25- # Protobuf
26- file (GLOB PROJECT_PROTOS ${CMAKE_CURRENT_SOURCE_DIR } /proto/*.proto )
27-
28- string (REPLACE ".proto" ".pb.cc" PROJECT_PROTO_SRCS "${PROJECT_PROTOS} " )
29- string (REPLACE ".proto" ".pb.h" PROJECT_PROTO_HDRS "${PROJECT_PROTOS} " )
30- string (REPLACE "/proto/" "/proto/tmp/" PROJECT_PROTO_TMP_FILES "${PROJECT_PROTO_SRCS} ;${PROJECT_PROTO_HDRS} " )
31- set_source_files_properties (${PROJECT_PROTO_SRCS} ${PROJECT_PROTO_HDRS}
32- PROPERTIES GENERATED TRUE )
33-
34- # Force a re-gen if any *.pb.* files are missing
35- # (only runs when cmake is run, but better than nothing)
36- foreach (file IN LISTS PROJECT_PROTO_SRCS PROJECT_PROTO_HDRS)
37- if (NOT EXISTS ${file} )
38- # message("Resetting generate_proto because '${file}' is missing")
39- file (REMOVE ${PROJECT_PROTO_TMP_FILES} )
40- break ()
41- endif ()
42- endforeach ()
43-
44- add_custom_command (
45- OUTPUT ${PROJECT_PROTO_TMP_FILES}
46- COMMAND protoc-bin -I=${dfhack_SOURCE_DIR}/library/proto/
47- -I=${CMAKE_CURRENT_SOURCE_DIR}/proto/
48- --cpp_out=${CMAKE_CURRENT_SOURCE_DIR}/proto/tmp/
49- ${PROJECT_PROTOS}
50- COMMAND ${PERL_EXECUTABLE} ${dfhack_SOURCE_DIR } /depends/copy-if-different.pl
51- ${PROJECT_PROTO_TMP_FILES}
52- ${CMAKE_CURRENT_SOURCE_DIR } /proto/
53- COMMENT "Generating plugin protobufs"
54- DEPENDS protoc-bin ${PROJECT_PROTOS}
55- )
56- add_custom_target (generate_proto DEPENDS ${PROJECT_PROTO_TMP_FILES} )
57-
5825set_source_files_properties ( Brushes.h PROPERTIES HEADER_FILE_ONLY TRUE )
5926
6027# Plugins
6128# If you are adding a plugin that you do not intend to commit to the DFHack repo,
6229# see instructions for adding "external" plugins at the end of this file.
6330
31+ # Example plugin that uses protobufs
32+ # proto file must be in the proto/ folder
33+ # dfhack_plugin(rename rename.cpp LINK_LIBRARIES lua PROTOBUFS rename)
34+
6435option (BUILD_SUPPORTED "Build the supported plugins (reveal, probe, etc.)." ON )
6536if (BUILD_SUPPORTED)
6637 dfhack_plugin (3dveins 3dveins.cpp )
@@ -133,7 +104,6 @@ if(BUILD_SUPPORTED)
133104 #dfhack_plugin(power-meter power-meter.cpp LINK_LIBRARIES lua)
134105 dfhack_plugin (regrass regrass.cpp LINK_LIBRARIES lua )
135106 add_subdirectory (remotefortressreader )
136- #dfhack_plugin(rename rename.cpp LINK_LIBRARIES lua PROTOBUFS rename)
137107 #add_subdirectory(rendermax)
138108 dfhack_plugin (reveal reveal.cpp LINK_LIBRARIES lua )
139109 dfhack_plugin (seedwatch seedwatch.cpp LINK_LIBRARIES lua )
0 commit comments