Przeglądaj źródła

CMake: add usage of ccache if it's available

ccache obviously don't give any real betefit with PCH, but still nice option to test.
Arseniy Shestakov 9 lat temu
rodzic
commit
2576dd4692
1 zmienionych plików z 7 dodań i 0 usunięć
  1. 7 0
      CMakeLists.txt

+ 7 - 0
CMakeLists.txt

@@ -3,6 +3,13 @@ cmake_minimum_required(VERSION 2.8.12)
 # TODO:
 # 1) Detection of Qt5 and compilation of launcher, unless explicitly disabled
 
+# Configure ccache if available
+find_program(CCACHE_FOUND ccache)
+if(CCACHE_FOUND)
+	set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
+	set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
+endif(CCACHE_FOUND)
+
 # where to look for cmake modules
 set(CMAKE_MODULE_PATH ${CMAKE_HOME_DIRECTORY}/cmake_modules)