From 657ccee7b0a7e0cc3762aa529688b530ae82d3b0 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Sun, 30 Nov 2014 17:19:14 +0100 Subject: Added a custom target for generating flatbuffers to ensure they are always built. That way we don't have to list the headers in the sources. --- CMakeLists.txt | 3 +++ client/CMakeLists.txt | 1 - resource/CMakeLists.txt | 1 - 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 09c6a1e..f16dc6a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,6 +28,9 @@ function(generate_flatbuffers) COMMAND ${FLATBUFFERS_FLATC_EXECUTABLE} -c -b --gen-includes -o ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/${fbs}.fbs DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${fbs}.fbs ) + set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${fbs}_generated.h PROPERTIES GENERATED 1) + string(REGEX REPLACE "/" "_" target_name ${fbs}) + add_custom_target(generate_bindings${target_name} ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${fbs}_generated.h) endforeach(fbs) endfunction(generate_flatbuffers) diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index de5fdbf..859f707 100644 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -5,7 +5,6 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) set(toynadiclient_SRCS main.cpp resourceaccess.cpp - ../common/handshake_generated.h ) add_executable(${PROJECT_NAME} ${toynadiclient_SRCS}) diff --git a/resource/CMakeLists.txt b/resource/CMakeLists.txt index c9980b8..d74c705 100644 --- a/resource/CMakeLists.txt +++ b/resource/CMakeLists.txt @@ -5,7 +5,6 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) set(toynadiresource_SRCS main.cpp listener.cpp - ../common/handshake_generated.h ) add_executable(${PROJECT_NAME} ${toynadiresource_SRCS}) -- cgit v1.2.3