Support ccache
authorChristopher Dunn <cdunn2001@gmail.com>
Mon, 19 Oct 2015 17:10:58 +0000 (12:10 -0500)
committerChristopher Dunn <cdunn2001@gmail.com>
Mon, 19 Oct 2015 17:10:58 +0000 (12:10 -0500)
http://stackoverflow.com/a/24305849/263998

CMakeLists.txt

index 7d459fd..2b3ab6e 100644 (file)
@@ -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()