diff options
author | David Partyka <dave.partyka@kitware.com> | 2010-10-26 14:03:21 (GMT) |
---|---|---|
committer | David Partyka <dave.partyka@kitware.com> | 2010-10-26 14:28:38 (GMT) |
commit | 16841987064cb79d3556034384458a36c4ceecef (patch) | |
tree | c8b6a266c1d84e67f879f39d30c1880aeafb4cd7 /Modules/GetPrerequisites.cmake | |
parent | be94c494eda5437bd7c026f6619d6ab040593e7a (diff) | |
download | CMake-16841987064cb79d3556034384458a36c4ceecef.zip CMake-16841987064cb79d3556034384458a36c4ceecef.tar.gz CMake-16841987064cb79d3556034384458a36c4ceecef.tar.bz2 |
Switch to CMAKE_PATH when doing PATH comparisons on Windows.
Users PATH may contain elements that end with backslash. This will escape the semicolon when iterating resulting in mismatches.
Fix indentation.
Fix whitespace
Diffstat (limited to 'Modules/GetPrerequisites.cmake')
-rw-r--r-- | Modules/GetPrerequisites.cmake | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake index e1dae46..40b682e 100644 --- a/Modules/GetPrerequisites.cmake +++ b/Modules/GetPrerequisites.cmake @@ -587,11 +587,14 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa # get_filename_component(gp_cmd_dir "${gp_cmd}" PATH) get_filename_component(gp_cmd_dlls_dir "${gp_cmd_dir}/../../Common7/IDE" ABSOLUTE) - file(TO_NATIVE_PATH "${gp_cmd_dlls_dir}" gp_cmd_dlls_dir) + # Use cmake paths as a user may have a PATH element ending with a backslash. + # This will escape the list delimiter and create havoc! + file(TO_CMAKE_PATH "${gp_cmd_dlls_dir}" gp_cmd_dlls_dir) if(EXISTS "${gp_cmd_dlls_dir}") # only add to the path if it is not already in the path set(gp_found_cmd_dlls_dir 0) - foreach(gp_env_path_element $ENV{PATH}) + file(TO_CMAKE_PATH "$ENV{PATH}" env_path) + foreach(gp_env_path_element ${env_path}) if("${gp_env_path_element}" STREQUAL "${gp_cmd_dlls_dir}") set(gp_found_cmd_dlls_dir 1) endif() |