Add USE_CCACHE option to CMake so that ccache can be forcibly disabled (#3661)

This commit is contained in:
James Le Cuirot 2019-03-14 20:19:55 +00:00 committed by Zach H
parent a522255baf
commit 6d27631764

View file

@ -25,12 +25,15 @@ ELSE()
ENDIF()
# Early detect ccache
OPTION(USE_CCACHE "Cache the build results with ccache" ON)
if(USE_CCACHE)
find_program(CCACHE_PROGRAM ccache)
if(CCACHE_PROGRAM)
# Support Unix Makefiles and Ninja
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}")
MESSAGE(STATUS "Found CCache ${CCACHE_PROGRAM}")
endif()
endif()
# A project name is needed for CPack
# Version can be overriden by git tags, see cmake/getversion.cmake