Fix wrong CCache version string (#12679)

Use CMAKE_MATCH_1 instead of CMAKE_MATCH_0 which holds the entire match.
This commit is contained in:
ceeac 2020-08-14 17:03:08 +02:00 committed by GitHub
parent 6282335873
commit d98838430c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -9,8 +9,9 @@ if (CCache_EXECUTABLE)
OUTPUT_VARIABLE CCache_VERSION_OUTPUT
)
string(REGEX MATCH "version ([0-9]+\\.[0-9]+\\.[0-9]+)" CCache_VERSION_TEMP ${CCache_VERSION_OUTPUT})
set(CCache_VERSION "${CMAKE_MATCH_0}")
if (CCache_VERSION_OUTPUT MATCHES "version ([0-9]+\\.[0-9]+\\.[0-9]+)")
set(CCache_VERSION "${CMAKE_MATCH_1}")
endif ()
endif (CCache_EXECUTABLE)
find_package_handle_standard_args(CCache