Skip to content

Commit 9e5b383

Browse files
authored
[cmake] use detected ccache executable (qgis#62726)
1 parent 69ff52e commit 9e5b383

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

CMakeLists.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,12 @@ endif()
108108
# Configure CCache if available
109109
option(USE_CCACHE "Use ccache" ON)
110110
if (USE_CCACHE)
111-
find_program(CCACHE_FOUND ccache)
112-
if(CCACHE_FOUND)
111+
find_program(CCACHE_EXE ccache)
112+
if(CCACHE_EXE)
113113
message(STATUS "ccache found")
114-
execute_process(COMMAND ccache --help OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE CCACHE_HELP)
115-
execute_process(COMMAND ccache --get-config sloppiness OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE CCACHE_SLOPPINESS)
116-
execute_process(COMMAND ccache --get-config compiler_type OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE CCACHE_COMPILER_TYPE)
114+
execute_process(COMMAND ${CCACHE_EXE} --help OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE CCACHE_HELP)
115+
execute_process(COMMAND ${CCACHE_EXE} --get-config sloppiness OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE CCACHE_SLOPPINESS)
116+
execute_process(COMMAND ${CCACHE_EXE} --get-config compiler_type OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE CCACHE_COMPILER_TYPE)
117117
string(FIND "${CCACHE_SLOPPINESS}" "pch_defines" fpch_defines_found_index)
118118
string(FIND "${CCACHE_SLOPPINESS}" "time_macros" time_macros_found_index)
119119
string(FIND "${CCACHE_SLOPPINESS}" "include_file_mtime" include_file_mtime_found_index)
@@ -156,7 +156,7 @@ if (USE_CCACHE)
156156
endif()
157157
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_INVOCATION_COMMAND}")
158158
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK "${CCACHE_INVOCATION_COMMAND}")
159-
endif(CCACHE_FOUND)
159+
endif(CCACHE_EXE)
160160
endif(USE_CCACHE)
161161

162162
if (USE_CCACHE AND MSVC)

0 commit comments

Comments
 (0)