summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2015-12-13 20:46:45 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2015-12-13 20:46:45 +0100
commit426d60cfe9b5e77e3ed73ac91614994aef8920ab (patch)
tree2013a318aa463b004c5564b105c1497d74f43f27
parent03f91093dcfd8c7adb3b1ddabbf006ca8e0586a1 (diff)
downloadsink-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.
-rw-r--r--CMakeLists.txt5
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)
17find_package(Qt5 COMPONENTS REQUIRED Core Widgets Network) 17find_package(Qt5 COMPONENTS REQUIRED Core Widgets Network)
18find_package(KF5 COMPONENTS REQUIRED Async) 18find_package(KF5 COMPONENTS REQUIRED Async)
19find_package(FlatBuffers REQUIRED) 19find_package(FlatBuffers REQUIRED)
20add_custom_target(generate_bindings)
20function(generate_flatbuffers _target) 21function(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)
33endfunction(generate_flatbuffers) 34endfunction(generate_flatbuffers)
34 35