From f44ecaa4f27e7538ddcad66d40e543bffa2d2d86 Mon Sep 17 00:00:00 2001 From: manuel Date: Sun, 4 Jun 2017 16:57:49 +0200 Subject: sync with upstream --- cmake/modules/FindCCache.cmake | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 cmake/modules/FindCCache.cmake (limited to 'cmake/modules/FindCCache.cmake') diff --git a/cmake/modules/FindCCache.cmake b/cmake/modules/FindCCache.cmake new file mode 100644 index 0000000..956dee2 --- /dev/null +++ b/cmake/modules/FindCCache.cmake @@ -0,0 +1,18 @@ +#.rst: +# FindCCache +# ---------- +# Finds ccache and sets it up as compiler wrapper. +# This should ideally be called before the call to project(). +# +# See: https://crascit.com/2016/04/09/using-ccache-with-cmake/ + +find_program(CCACHE_PROGRAM ccache) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(CCache REQUIRED_VARS CCACHE_PROGRAM) + +if(CCACHE_FOUND) + # Supports Unix Makefiles and Ninja + set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}") + set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK "${CCACHE_PROGRAM}") +endif() -- cgit v1.2.3