summaryrefslogtreecommitdiffstats
path: root/Modules/GetPrerequisites.cmake
diff options
context:
space:
mode:
authorDavid Partyka <dave.partyka@kitware.com>2010-10-25 17:40:35 (GMT)
committerDavid Partyka <dave.partyka@kitware.com>2010-10-25 17:40:35 (GMT)
commitbe94c494eda5437bd7c026f6619d6ab040593e7a (patch)
tree65f0c0d65607f55a3990fe350d7e96df6b75c8ee /Modules/GetPrerequisites.cmake
parent06b5eaa3cf7dc534415473eb1f3bfef191008999 (diff)
downloadCMake-be94c494eda5437bd7c026f6619d6ab040593e7a.zip
CMake-be94c494eda5437bd7c026f6619d6ab040593e7a.tar.gz
CMake-be94c494eda5437bd7c026f6619d6ab040593e7a.tar.bz2
Fixed appending PATH to dumpbin tool from growing without bounds.
IF(... MATCHES ...) used for comparing directories chokes especially in the case of C:\Program Files (x86)\<blah> because of regex pattern matching. Switched this to use STREQUAL in a loop instead.
Diffstat (limited to 'Modules/GetPrerequisites.cmake')
-rw-r--r--Modules/GetPrerequisites.cmake12
1 files changed, 10 insertions, 2 deletions
diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake
index c83da4f..e1dae46 100644
--- a/Modules/GetPrerequisites.cmake
+++ b/Modules/GetPrerequisites.cmake
@@ -587,11 +587,19 @@ 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)
if(EXISTS "${gp_cmd_dlls_dir}")
# only add to the path if it is not already in the path
- if(NOT "$ENV{PATH}" MATCHES "${gp_cmd_dlls_dir}")
+ set(gp_found_cmd_dlls_dir 0)
+ 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()
+ endforeach(gp_env_path_element)
+
+ if(NOT gp_found_cmd_dlls_dir)
set(ENV{PATH} "$ENV{PATH};${gp_cmd_dlls_dir}")
- endif(NOT "$ENV{PATH}" MATCHES "${gp_cmd_dlls_dir}")
+ endif()
endif(EXISTS "${gp_cmd_dlls_dir}")
endif("${gp_tool}" STREQUAL "dumpbin")
#