From bce02c4804d14ae2257ad5f5e7fae4e2baa74503 Mon Sep 17 00:00:00 2001 From: Bernd Waibel Date: Thu, 31 Dec 2020 13:31:47 +0100 Subject: [PATCH 2/2] CMakeLists.txt: add option for ccache Signed-off-by: Bernd Waibel --- CMakeLists.txt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f4dabf7..17b9fad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,9 +8,12 @@ if (POLICY CMP0072) cmake_policy(SET CMP0072 OLD) endif(POLICY CMP0072) -find_program(CCACHE_PROGRAM ccache) #This check should occur before project() -if(CCACHE_PROGRAM) - set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}") +option(FREECAD_USE_CCACHE "Use ccache to build FreeCAD" OFF) +if(FREECAD_USE_CCACHE) + find_program(CCACHE_PROGRAM ccache) #This check should occur before project() + if(CCACHE_PROGRAM) + set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}") + endif() endif() project(FreeCAD) -- 2.30.0