diff --git a/src/protobuf_gen/keep_the_directory b/src/protobuf_gen/keep_the_directory deleted file mode 100644 index e69de29..0000000 diff --git a/urchin-util/CMakeLists.txt b/urchin-util/CMakeLists.txt index b323a3a..00b65e8 100644 --- a/urchin-util/CMakeLists.txt +++ b/urchin-util/CMakeLists.txt @@ -28,7 +28,10 @@ file(GLOB_RECURSE PROTOBUF_PROTO_FILES ${CMAKE_CURRENT_SOURCE_DIR}/protobuf/*.proto) file(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/src/protobuf_gen/) add_custom_target(GenerateProtobuf) -add_custom_command( +execute_process( # Execute process is used to generate this code before the initial file glob + COMMAND ${protoc-c_EXECUTABLE} --c_out=${CMAKE_CURRENT_SOURCE_DIR}/src/protobuf_gen/ --proto_path=${CMAKE_CURRENT_SOURCE_DIR}/protobuf/ ${PROTOBUF_PROTO_FILES} +) +add_custom_command( # add_custom command is used to update the generated code after .proto files have been modified OUTPUT GenerateProtobuf DEPENDS ${protoc-c_EXECUTABLE} COMMAND ${protoc-c_EXECUTABLE} --c_out=${CMAKE_CURRENT_SOURCE_DIR}/src/protobuf_gen/ --proto_path=${CMAKE_CURRENT_SOURCE_DIR}/protobuf/ ${PROTOBUF_PROTO_FILES}