Commit a7d1c4ec authored by Brad King's avatar Brad King

CMakeDetermineCompilerId: Fix compiler id with square brackets in the path

We use file(GLOB) to load the list of files produced by compiling the
compiler identification source.  Encode square brackets in the path to
the directory so that they are not treated as special characters in the
globbing expression.  Otherwise we fail to find any files when the path
contains square brackets and the compiler id is unknown.
Reported-by: default avatarEsch Nigma <eschnigma@openmailbox.org>
parent f1ff6301
...@@ -365,14 +365,15 @@ ${CMAKE_${lang}_COMPILER_ID_OUTPUT} ...@@ -365,14 +365,15 @@ ${CMAKE_${lang}_COMPILER_ID_OUTPUT}
# Find the executable produced by the compiler, try all files in the # Find the executable produced by the compiler, try all files in the
# binary dir. # binary dir.
string(REGEX REPLACE "([][])" "[\\1]" _glob_id_dir "${CMAKE_${lang}_COMPILER_ID_DIR}")
file(GLOB files file(GLOB files
RELATIVE ${CMAKE_${lang}_COMPILER_ID_DIR} RELATIVE ${CMAKE_${lang}_COMPILER_ID_DIR}
# normal case # normal case
${CMAKE_${lang}_COMPILER_ID_DIR}/* ${_glob_id_dir}/*
# com.apple.package-type.bundle.unit-test # com.apple.package-type.bundle.unit-test
${CMAKE_${lang}_COMPILER_ID_DIR}/*.xctest/* ${_glob_id_dir}/*.xctest/*
) )
list(REMOVE_ITEM files "${src}") list(REMOVE_ITEM files "${src}")
set(COMPILER_${lang}_PRODUCED_FILES "") set(COMPILER_${lang}_PRODUCED_FILES "")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment