summaryrefslogtreecommitdiffstats
path: root/Modules/ExternalProject.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2010-08-03 20:21:55 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2010-08-03 20:21:55 (GMT)
commit7e578b8d73c52c96d9099e329dd1e1d6f7029b87 (patch)
tree9aea9a32cc4181e566b89958a99837c1817c475a /Modules/ExternalProject.cmake
parenta1b9388bc3b225594af55749b72f58e9c896df10 (diff)
parented43ea603f9ea8c4eed53315e4987483c5801c63 (diff)
downloadCMake-7e578b8d73c52c96d9099e329dd1e1d6f7029b87.zip
CMake-7e578b8d73c52c96d9099e329dd1e1d6f7029b87.tar.gz
CMake-7e578b8d73c52c96d9099e329dd1e1d6f7029b87.tar.bz2
Merge topic 'ExternalProject-cygwin-make'
ed43ea6 ExternalProject: Fix $(MAKE) with cygpath on Windows
Diffstat (limited to 'Modules/ExternalProject.cmake')
-rw-r--r--Modules/ExternalProject.cmake20
1 files changed, 20 insertions, 0 deletions
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index fcb5199..b42e42b 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -613,11 +613,29 @@ function(_ep_write_log_script name step cmd_var)
set(command "${${cmd_var}}")
set(make "")
+ set(code_cygpath_make "")
if("${command}" MATCHES "^\\$\\(MAKE\\)")
# GNU make recognizes the string "$(MAKE)" as recursive make, so
# ensure that it appears directly in the makefile.
string(REGEX REPLACE "^\\$\\(MAKE\\)" "\${make}" command "${command}")
set(make "-Dmake=$(MAKE)")
+
+ if(WIN32 AND NOT CYGWIN)
+ set(code_cygpath_make "
+if(\${make} MATCHES \"^/\")
+ execute_process(
+ COMMAND cygpath -w \${make}
+ OUTPUT_VARIABLE cygpath_make
+ ERROR_VARIABLE cygpath_make
+ RESULT_VARIABLE cygpath_error
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+ if(NOT cygpath_error)
+ set(make \${cygpath_make})
+ endif()
+endif()
+")
+ endif()
endif()
set(config "")
@@ -630,6 +648,7 @@ function(_ep_write_log_script name step cmd_var)
# script so all output can be sent to one log file.
if("${command}" MATCHES ";COMMAND;")
set(code_execute_process "
+${code_cygpath_make}
execute_process(COMMAND \${command} RESULT_VARIABLE result)
if(result)
set(msg \"Command failed (\${result}):\\n\")
@@ -661,6 +680,7 @@ endif()
set(script ${stamp_dir}/${name}-${step}.cmake)
set(logbase ${stamp_dir}/${name}-${step})
file(WRITE ${script} "
+${code_cygpath_make}
set(command \"${command}\")
execute_process(
COMMAND \${command}