summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCsaba Kertesz <[email protected]>2017-08-13 17:19:09 +0300
committerCsaba Kertesz <[email protected]>2017-09-26 00:08:05 +0300
commitde7b8dd23c97ca290de3b7fc742e240ba67f3fb3 (patch)
tree45f3290f3065eab9e20333511056b6f72bfeb135
parent144f440cb76c887714c06e0a075002a3936f9426 (diff)
Add ccache support
-rw-r--r--CMakeLists.txt11
1 files changed, 11 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 11016c5..e9f3ca9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -23,6 +23,17 @@ endif()
find_package(ECM ${ECM_VERSION} REQUIRED NO_MODULE)
+
+# Ccache support
+if (UNIX OR APPLE)
+ find_program(CCACHE_FOUND ccache)
+ set(CCACHE_SUPPORT OFF CACHE BOOL "Enable ccache support")
+ if (CCACHE_FOUND AND CCACHE_SUPPORT MATCHES ON)
+ set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
+ set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
+ endif ()
+endif ()
+
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
include(KDEInstallDirs)