summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2014-11-30 17:19:14 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2014-11-30 17:19:14 +0100
commit657ccee7b0a7e0cc3762aa529688b530ae82d3b0 (patch)
treeabc02844568949f512802695566307e9327f688f /CMakeLists.txt
parent5f1486a90d14a82848b517346aa9b2fd41d62265 (diff)
downloadsink-657ccee7b0a7e0cc3762aa529688b530ae82d3b0.tar.gz
sink-657ccee7b0a7e0cc3762aa529688b530ae82d3b0.zip
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.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt3
1 files changed, 3 insertions, 0 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)
28 COMMAND ${FLATBUFFERS_FLATC_EXECUTABLE} -c -b --gen-includes -o ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/${fbs}.fbs 28 COMMAND ${FLATBUFFERS_FLATC_EXECUTABLE} -c -b --gen-includes -o ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/${fbs}.fbs
29 DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${fbs}.fbs 29 DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${fbs}.fbs
30 ) 30 )
31 set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${fbs}_generated.h PROPERTIES GENERATED 1)
32 string(REGEX REPLACE "/" "_" target_name ${fbs})
33 add_custom_target(generate_bindings${target_name} ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${fbs}_generated.h)
31 endforeach(fbs) 34 endforeach(fbs)
32endfunction(generate_flatbuffers) 35endfunction(generate_flatbuffers)
33 36