diff options
author | Aaron Seigo <aseigo@kde.org> | 2014-11-30 13:51:21 +0100 |
---|---|---|
committer | Aaron Seigo <aseigo@kde.org> | 2014-11-30 13:51:21 +0100 |
commit | b49cead47537d8d1d2c78cb4596bb828fd94b347 (patch) | |
tree | 1bb531f7d856269bb734c5a5eeeea473b375fe64 /CMakeLists.txt | |
parent | 97b79eeb86eedee57630b8d29f6eeab08ccb02b0 (diff) | |
download | sink-b49cead47537d8d1d2c78cb4596bb828fd94b347.tar.gz sink-b49cead47537d8d1d2c78cb4596bb828fd94b347.zip |
create a common lib, autogen the buffer classes there dynamically
simplifies the generate_buffers function a bit.
only missing part now: get the binaries to rebuild when the buffer
class is updated. apparently this doesn't cause the common library
to rebuild and so the client and resource binaries don't know they
need to rebuild automatically. but at least the _generated.h files
are now dynamically created. huzzah for that.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 91c4568..09c6a1e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
@@ -20,10 +20,14 @@ include(ECMPackageConfigHelpers) | |||
20 | 20 | ||
21 | find_package(Qt5Core REQUIRED) | 21 | find_package(Qt5Core REQUIRED) |
22 | find_package(FlatBuffers REQUIRED) | 22 | find_package(FlatBuffers REQUIRED) |
23 | function(generate_flatbuffers dest) | 23 | function(generate_flatbuffers) |
24 | # TODO: move the file from ${fbs}_generated.h to just ${fbs}? | ||
25 | foreach(fbs ${ARGN}) | 24 | foreach(fbs ${ARGN}) |
26 | execute_process(COMMAND ${FLATBUFFERS_FLATC_EXECUTABLE} -c -b --gen-includes -o ${dest} ${CMAKE_CURRENT_SOURCE_DIR}/${fbs}) | 25 | message("making ${CMAKE_CURRENT_BINARY_DIR}/${fbs}_generated.h from ${CMAKE_CURRENT_SOURCE_DIR}/${fbs}.fbs") |
26 | add_custom_command( | ||
27 | OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${fbs}_generated.h | ||
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 | ||
30 | ) | ||
27 | endforeach(fbs) | 31 | endforeach(fbs) |
28 | endfunction(generate_flatbuffers) | 32 | endfunction(generate_flatbuffers) |
29 | 33 | ||