diff options
author | Brad King <brad.king@kitware.com> | 2016-06-02 14:32:07 -0400 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-06-02 14:32:07 -0400 |
commit | a7d1c4ec3f6e955262e3ae49e77430259e0bc12f (patch) | |
tree | d0a998e5832c032bf74fe0c7165f597aaed5ad4f /Modules/CMakeDetermineCompilerId.cmake | |
parent | f1ff6301eafe61f5e9d7376d3713a0f37d3a2015 (diff) | |
download | cmake-a7d1c4ec3f6e955262e3ae49e77430259e0bc12f.tar.gz |
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: Esch Nigma <eschnigma@openmailbox.org>
Diffstat (limited to 'Modules/CMakeDetermineCompilerId.cmake')
-rw-r--r-- | Modules/CMakeDetermineCompilerId.cmake | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index 465989de18..70ceaa6f8d 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -365,14 +365,15 @@ ${CMAKE_${lang}_COMPILER_ID_OUTPUT} # Find the executable produced by the compiler, try all files in the # binary dir. + string(REGEX REPLACE "([][])" "[\\1]" _glob_id_dir "${CMAKE_${lang}_COMPILER_ID_DIR}") file(GLOB files RELATIVE ${CMAKE_${lang}_COMPILER_ID_DIR} # normal case - ${CMAKE_${lang}_COMPILER_ID_DIR}/* + ${_glob_id_dir}/* # com.apple.package-type.bundle.unit-test - ${CMAKE_${lang}_COMPILER_ID_DIR}/*.xctest/* + ${_glob_id_dir}/*.xctest/* ) list(REMOVE_ITEM files "${src}") set(COMPILER_${lang}_PRODUCED_FILES "") |