From b4d0596f6ccf21e574cce0e638e76e3927c86187 Mon Sep 17 00:00:00 2001 From: Matthias Hochsteger Date: Thu, 19 Nov 2015 14:24:36 +0100 Subject: [PATCH] ccache option --- CMakeLists.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 982817fa..8859ff9e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,6 +24,17 @@ option( USE_JPEG "enable snapshots using library libjpeg" OFF ) option( USE_MPEG "enable video recording with FFmpeg, uses libavcodec" OFF ) option( INTEL_MIC "cross compile for intel xeon phi") option( INSTALL_PROFILES "install environment variable settings to /etc/profile.d" OFF ) +option( USE_CCACHE "use ccache") + + +####################################################################### +if(USE_CCACHE) + 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) +endif(USE_CCACHE) ####################################################################### if(USE_NATIVE_ARCH)