summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeDetermineCompilerId.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-09-03 17:58:42 (GMT)
committerBrad King <brad.king@kitware.com>2013-09-03 18:04:25 (GMT)
commit8c891f86cc2cbe346d4f6459d01c6d24c27ec2f1 (patch)
tree55b47a4771914d7184975845cf0c3d03317e68e7 /Modules/CMakeDetermineCompilerId.cmake
parentdccc2b84a7d4abe0a0d3e064aa2a067ab341ecaf (diff)
downloadCMake-8c891f86cc2cbe346d4f6459d01c6d24c27ec2f1.zip
CMake-8c891f86cc2cbe346d4f6459d01c6d24c27ec2f1.tar.gz
CMake-8c891f86cc2cbe346d4f6459d01c6d24c27ec2f1.tar.bz2
VS: Tolerate diagnostic output while detecting cl (#14387)
When the VS IDE build output setting Tools -> Options -> Projects and Solutions -> Build and Run -> MSBuild project output verbosity is set to "Diagnostic" the build output contains a " (TaskId:###)" suffix on the CMAKE_<lang>_COMPILER= line used to extract the compiler executable location. Strip this suffix before checking that the reported location exists.
Diffstat (limited to 'Modules/CMakeDetermineCompilerId.cmake')
-rw-r--r--Modules/CMakeDetermineCompilerId.cmake3
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index ebd9ce0..cc36ec4 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -157,7 +157,8 @@ Id flags: ${testflags}
)
# Match the compiler location line printed out.
if("${CMAKE_${lang}_COMPILER_ID_OUTPUT}" MATCHES "CMAKE_${lang}_COMPILER=([^%\r\n]+)[\r\n]")
- set(_comp "${CMAKE_MATCH_1}")
+ # Strip VS diagnostic output from the end of the line.
+ string(REGEX REPLACE " \\(TaskId:[0-9]*\\)$" "" _comp "${CMAKE_MATCH_1}")
if(EXISTS "${_comp}")
file(TO_CMAKE_PATH "${_comp}" _comp)
set(CMAKE_${lang}_COMPILER_ID_TOOL "${_comp}" PARENT_SCOPE)