diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-12-13 20:46:45 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-12-13 20:46:45 +0100 |
commit | 426d60cfe9b5e77e3ed73ac91614994aef8920ab (patch) | |
tree | 2013a318aa463b004c5564b105c1497d74f43f27 /CMakeLists.txt | |
parent | 03f91093dcfd8c7adb3b1ddabbf006ca8e0586a1 (diff) | |
download | sink-426d60cfe9b5e77e3ed73ac91614994aef8920ab.tar.gz sink-426d60cfe9b5e77e3ed73ac91614994aef8920ab.zip |
Avoid constantly rebuilding the whole project.
The buffer definitions seldomly change, yet we rebuild
everything everytime. With this change buffer definitions are only
rebuild with "make generate_bindings". I so far failed to only recompile
the buffer if the bufferschema was modifed, so we'll just try with this.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 0ae6bcf..d4c305e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
@@ -17,6 +17,7 @@ include(KDEInstallDirs) | |||
17 | find_package(Qt5 COMPONENTS REQUIRED Core Widgets Network) | 17 | find_package(Qt5 COMPONENTS REQUIRED Core Widgets Network) |
18 | find_package(KF5 COMPONENTS REQUIRED Async) | 18 | find_package(KF5 COMPONENTS REQUIRED Async) |
19 | find_package(FlatBuffers REQUIRED) | 19 | find_package(FlatBuffers REQUIRED) |
20 | add_custom_target(generate_bindings) | ||
20 | function(generate_flatbuffers _target) | 21 | function(generate_flatbuffers _target) |
21 | foreach(fbs ${ARGN}) | 22 | foreach(fbs ${ARGN}) |
22 | message("making ${CMAKE_CURRENT_BINARY_DIR}/${fbs}_generated.h from ${CMAKE_CURRENT_SOURCE_DIR}/${fbs}.fbs") | 23 | message("making ${CMAKE_CURRENT_BINARY_DIR}/${fbs}_generated.h from ${CMAKE_CURRENT_SOURCE_DIR}/${fbs}.fbs") |
@@ -27,8 +28,8 @@ function(generate_flatbuffers _target) | |||
27 | ) | 28 | ) |
28 | set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${fbs}_generated.h PROPERTIES GENERATED 1) | 29 | set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${fbs}_generated.h PROPERTIES GENERATED 1) |
29 | string(REGEX REPLACE "/" "_" target_name ${fbs}) | 30 | string(REGEX REPLACE "/" "_" target_name ${fbs}) |
30 | add_custom_target(${_target}-generate_bindings${target_name} ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${fbs}_generated.h) | 31 | add_custom_target(${_target}-generate_bindings${target_name} DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${fbs}_generated.h) |
31 | add_dependencies(${_target} ${_target}-generate_bindings${target_name}) | 32 | add_dependencies(generate_bindings ${_target}-generate_bindings${target_name}) |
32 | endforeach(fbs) | 33 | endforeach(fbs) |
33 | endfunction(generate_flatbuffers) | 34 | endfunction(generate_flatbuffers) |
34 | 35 | ||