From d1a2b94d5b1adceb7d6a9f8c0f40c95dd7e64980 Mon Sep 17 00:00:00 2001 From: Christopher Dunn Date: Mon, 19 Oct 2015 12:10:58 -0500 Subject: [PATCH] Support ccache http://stackoverflow.com/a/24305849/263998 --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7d459fd..2b3ab6e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -104,6 +104,12 @@ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") # not yet ready for -Wsign-conversion endif() +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) + IF(JSONCPP_WITH_WARNING_AS_ERROR) UseCompilationWarningAsError() ENDIF()