From 04779d45807c53650ed478e01a3a4bdb58594b37 Mon Sep 17 00:00:00 2001 From: Sascha Kratky Date: Tue, 15 Aug 2017 15:37:48 +0200 Subject: [PATCH] convert paths to native paths under Windows --- CMake/cotire.cmake | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/CMake/cotire.cmake b/CMake/cotire.cmake index 00f1af5..12e508c 100644 --- a/CMake/cotire.cmake +++ b/CMake/cotire.cmake @@ -889,6 +889,9 @@ function (cotire_init_compile_cmd _cmdVar _language _compilerLauncher _compilerE if (NOT _compilerArg1) set (_compilerArg1 ${CMAKE_${_language}_COMPILER_ARG1}) endif() + if (WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel") + file (TO_NATIVE_PATH "${_compilerExe}" _compilerExe) + endif() string (STRIP "${_compilerArg1}" _compilerArg1) if ("${CMAKE_GENERATOR}" MATCHES "Make|Ninja") # compiler launcher is only supported for Makefile and Ninja @@ -1246,7 +1249,15 @@ function (cotire_scan_includes _includesVar) set (${_includesVar} "" PARENT_SCOPE) return() endif() - list (APPEND _cmd ${_existingSourceFiles}) + # add source files to be scanned + if (WIN32 AND "${_option_COMPILER_ID}" MATCHES "MSVC|Intel") + foreach (_sourceFile ${_existingSourceFiles}) + file (TO_NATIVE_PATH "${_sourceFile}" _sourceFileNative) + list (APPEND _cmd "${_sourceFileNative}") + endforeach() + else() + list (APPEND _cmd ${_existingSourceFiles}) + endif() if (COTIRE_VERBOSE) message (STATUS "execute_process: ${_cmd}") endif()