diff options
| author | Mike Stewart | 2012-01-20 09:17:08 -0800 |
|---|---|---|
| committer | Mike Stewart | 2012-01-20 09:17:08 -0800 |
| commit | 941c643b5cacbde56a4fc3531f14985f40d67ad1 (patch) | |
| tree | baa864e31722850eecf70b5f26558d4129cda252 /plugins/mapexport | |
| parent | fb41e457c4af7f8e649fb8487f13ac58da41f70d (diff) | |
| download | dfhack-941c643b5cacbde56a4fc3531f14985f40d67ad1.tar.gz dfhack-941c643b5cacbde56a4fc3531f14985f40d67ad1.tar.bz2 dfhack-941c643b5cacbde56a4fc3531f14985f40d67ad1.tar.xz | |
Cleaned up the protobuf build a bit, and made git ignore files generated in doing so. Fixed building mapexport on Linux by forcing CMake to create a directory for protobuf output files.
Diffstat (limited to 'plugins/mapexport')
| -rw-r--r-- | plugins/mapexport/CMakeLists.txt | 8 | ||||
| -rw-r--r-- | plugins/mapexport/mapexport.cpp | 6 |
2 files changed, 8 insertions, 6 deletions
diff --git a/plugins/mapexport/CMakeLists.txt b/plugins/mapexport/CMakeLists.txt index 722ac663..b28c0e42 100644 --- a/plugins/mapexport/CMakeLists.txt +++ b/plugins/mapexport/CMakeLists.txt @@ -26,10 +26,12 @@ proto/Tile.pb.cc SET_SOURCE_FILES_PROPERTIES( ${PROJECT_HDRS} PROPERTIES HEADER_FILE_ONLY TRUE) LIST(APPEND PROJECT_SRCS ${PROJECT_HDRS}) +FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/proto) + ADD_CUSTOM_COMMAND( OUTPUT proto/Tile.pb.cc proto/Tile.pb.h -COMMAND protoc -I=${CMAKE_CURRENT_SOURCE_DIR}/proto --cpp_out=proto ${CMAKE_CURRENT_SOURCE_DIR}/proto/Tile.proto -DEPENDS protoc ${CMAKE_CURRENT_SOURCE_DIR}/proto/Tile.proto +COMMAND protoc-bin -I=${CMAKE_CURRENT_SOURCE_DIR}/proto --cpp_out=${CMAKE_CURRENT_BINARY_DIR}/proto ${CMAKE_CURRENT_SOURCE_DIR}/proto/Tile.proto +DEPENDS protoc-bin ${CMAKE_CURRENT_SOURCE_DIR}/proto/Tile.proto ) -DFHACK_PLUGIN(mapexport ${PROJECT_SRCS} ${PROJECT_HDRS} LINK_LIBRARIES libprotobuf-lite) +DFHACK_PLUGIN(mapexport ${PROJECT_SRCS} ${PROJECT_HDRS} LINK_LIBRARIES protobuf-lite) diff --git a/plugins/mapexport/mapexport.cpp b/plugins/mapexport/mapexport.cpp index d1a02225..b788e33a 100644 --- a/plugins/mapexport/mapexport.cpp +++ b/plugins/mapexport/mapexport.cpp @@ -14,7 +14,7 @@ DFhackCExport const char * plugin_name ( void ) DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands) { - GOOGLE_PROTOBUF_VERIFY_VERSION; + GOOGLE_PROTOBUF_VERIFY_VERSION; commands.clear(); commands.push_back(PluginCommand("mapexport", "Starts up and shuts down protobufs.", mapexport, true)); return CR_OK; @@ -22,7 +22,7 @@ DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> DFhackCExport command_result plugin_shutdown ( Core * c ) { - google::protobuf::ShutdownProtobufLibrary(); + google::protobuf::ShutdownProtobufLibrary(); return CR_OK; } @@ -38,7 +38,7 @@ DFhackCExport command_result mapexport (Core * c, std::vector <std::string> & pa } c->Suspend(); - dfproto::Tile tile; + dfproto::Tile tile; c->con.print("Hold on, I'm working on it!\n"); c->Resume(); return CR_OK; |
