breakhack/cmake/FindCCache.cmake
Linus_Probert a4df4c6079 Adds ccache to build
This is mostly for fun and because I want to see how it works in travis.
2018-02-16 10:13:16 +01:00

17 lines
556 B
CMake

# 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()