summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeClDeps.cmake
diff options
context:
space:
mode:
authorPeter Kümmel <syntheticpp@gmx.net>2012-08-27 12:49:51 (GMT)
committerPeter Kümmel <syntheticpp@gmx.net>2012-08-27 12:49:51 (GMT)
commit0af27f1f2a18c9e2335d22444777f1a6559000b5 (patch)
treed3a672eb7505d0ae7084d66cc4158c08e2ccde8b /Modules/CMakeClDeps.cmake
parentf32e7957b4f6cb57e396ec018947d46420072671 (diff)
downloadCMake-0af27f1f2a18c9e2335d22444777f1a6559000b5.zip
CMake-0af27f1f2a18c9e2335d22444777f1a6559000b5.tar.gz
CMake-0af27f1f2a18c9e2335d22444777f1a6559000b5.tar.bz2
Ninja: also detect /showInclude prefix for icl
Diffstat (limited to 'Modules/CMakeClDeps.cmake')
-rw-r--r--Modules/CMakeClDeps.cmake11
1 files changed, 4 insertions, 7 deletions
diff --git a/Modules/CMakeClDeps.cmake b/Modules/CMakeClDeps.cmake
index b52641c..0214ead 100644
--- a/Modules/CMakeClDeps.cmake
+++ b/Modules/CMakeClDeps.cmake
@@ -26,12 +26,9 @@ if(MSVC_C_ARCHITECTURE_ID AND CMAKE_GENERATOR MATCHES "Ninja" AND CMAKE_C_COMPIL
file(WRITE ${showdir}/foo.h "\n")
file(WRITE ${showdir}/main.c "#include \"foo.h\" \nint main(){}\n")
execute_process(COMMAND ${CMAKE_C_COMPILER} /nologo /showIncludes ${showdir}/main.c
- WORKING_DIRECTORY ${showdir} OUTPUT_VARIABLE showOut)
- string(REPLACE main.c "" showOut1 ${showOut})
- string(REPLACE "/" "\\" header1 ${showdir}/foo.h)
- string(TOLOWER ${header1} header2)
- string(REPLACE ${header2} "" showOut2 ${showOut1})
- string(REPLACE "\n" "" showOut3 ${showOut2})
+ WORKING_DIRECTORY ${showdir} OUTPUT_VARIABLE outLine)
+ string(REGEX MATCH "\n([^:]*:[^:]*:[ \t]*)" tmp "${outLine}")
+ set(localizedPrefix "${CMAKE_MATCH_1}")
set(SET_CMAKE_CMCLDEPS_EXECUTABLE "set(CMAKE_CMCLDEPS_EXECUTABLE \"${CMAKE_CMCLDEPS_EXECUTABLE}\")")
- set(SET_CMAKE_CL_SHOWINCLUDE_PREFIX "set(CMAKE_CL_SHOWINCLUDE_PREFIX \"${showOut3}\")")
+ set(SET_CMAKE_CL_SHOWINCLUDE_PREFIX "set(CMAKE_CL_SHOWINCLUDE_PREFIX \"${localizedPrefix}\")")
endif()