diff options
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 | ||