From 5b8f50c82340dcab3ca5f13ad722c8cf9b1a86a5 Mon Sep 17 00:00:00 2001
From: Lars Bilke <lars.bilke@ufz.de>
Date: Wed, 15 Apr 2020 09:53:51 +0200
Subject: [PATCH] [CMake] Added option OGS_DISABLE_CCACHE

---
 CMakeLists.txt                  | 1 +
 scripts/cmake/CCacheSetup.cmake | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9a996686f90..2da13ecc73e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -30,6 +30,7 @@ endif()
 option(OGS_USE_CONAN "Should Conan package manager be used?" ON)
 set(OGS_CONAN_BUILD "missing" CACHE STRING "Possible values: all, missing, \
     never or list of libs to build")
+option(OGS_DISABLE_CCACHE "Disables ccache compiler cache." OFF)
 
 # Third-party libraries, names come from Conan package names
 set(OGS_LIBS
diff --git a/scripts/cmake/CCacheSetup.cmake b/scripts/cmake/CCacheSetup.cmake
index c5ba97a4612..e00f95edbcc 100644
--- a/scripts/cmake/CCacheSetup.cmake
+++ b/scripts/cmake/CCacheSetup.cmake
@@ -1,4 +1,4 @@
-if(NOT CCACHE_TOOL_PATH)
+if(NOT CCACHE_TOOL_PATH OR OGS_DISABLE_CCACHE)
     return()
 endif()
 
-- 
GitLab