Skip to content
Snippets Groups Projects
Commit 3414c294 authored by Guilherme Amadio's avatar Guilherme Amadio
Browse files

Improve ccache setup in CMakeLists.txt

CMAKE_IGNORE_PATH is empty by default, so we should not ignore
it if set by the user, since that's a surprising behavior.

http://www.catb.org/esr/writings/taoup/html/ch01s06.html#id2878339
parent 399be047
No related branches found
No related tags found
No related merge requests found
......@@ -62,20 +62,16 @@ include(CheckCompiler)
#---Enable CCache ------------------------------------------------------------------------------
if(ccache)
set(CMAKE_IGNORE_PATH_TMP ${CMAKE_IGNORE_PATH})
unset(CMAKE_IGNORE_PATH)
find_program(CCACHE_COMMAND NAMES ccache ccache-swig)
mark_as_advanced(CCACHE_COMMAND ${CCACHE_COMMAND})
find_program(ccache_cmd NAMES ccache ccache-swig)
mark_as_advanced(ccache_cmd ${ccache_cmd})
set(CMAKE_IGNORE_PATH ${CMAKE_IGNORE_PATH_TMP})
if(ccache_cmd)
message(STATUS "Using ccache for building")
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
else()
message(STATUS "Could NOT find ccache")
endif()
if(EXISTS ${CCACHE_COMMAND})
message(STATUS "Found ccache: ${CCACHE_COMMAND}")
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${CCACHE_COMMAND})
else()
message(STATUS "Could NOT find ccache")
set(ccache OFF CACHE BOOL "Use ccache (disabled since ccache was not found)" FORCE)
endif()
endif()
#---Enable test coverage -----------------------------------------------------------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment