summaryrefslogtreecommitdiff
path: root/Tests/CMakeTestAllGenerators
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2011-07-29 11:04:48 -0400
committerDavid Cole <david.cole@kitware.com>2011-07-29 11:13:33 -0400
commit0baf5659c6222175b5d0a5b47d45e145dbdb8400 (patch)
tree4fc697c6ddd4446f2e6970e36aa4364953fb77f1 /Tests/CMakeTestAllGenerators
parent5ef20b2dc54474ceba1c81a75e8c3fc558d505fa (diff)
downloadcmake-0baf5659c6222175b5d0a5b47d45e145dbdb8400.tar.gz
Ensure libgmp-10.dll is in the PATH for CMakeTestAllGenerators
But only if it exists at the default location: C:/MinGW/bin/libgmp-10.dll This is so that the pop-up dialog about not being able to load that dll does not hang the test when there's nobody watching.
Diffstat (limited to 'Tests/CMakeTestAllGenerators')
-rw-r--r--Tests/CMakeTestAllGenerators/RunCMake.cmake22
1 files changed, 22 insertions, 0 deletions
diff --git a/Tests/CMakeTestAllGenerators/RunCMake.cmake b/Tests/CMakeTestAllGenerators/RunCMake.cmake
index dcf4a23c62..6d27d3be17 100644
--- a/Tests/CMakeTestAllGenerators/RunCMake.cmake
+++ b/Tests/CMakeTestAllGenerators/RunCMake.cmake
@@ -60,6 +60,28 @@ message(STATUS "CTEST_FULL_OUTPUT (Avoid ctest truncation of output)")
message(STATUS "CMake generators='${generators}'")
+# If we'll be testing any of the MinGW Makefiles generators, adjust the
+# ENV{PATH} to make sure libgmp-10.dll can be loaded as needed. But only if
+# the testing machine has a default MinGW install... (If you have a
+# non-default install, append to the PATH before running the test...)
+#
+if(generators MATCHES "MinGW Makefiles")
+ if(EXISTS "C:/MinGW/bin/libgmp-10.dll")
+ string(TOLOWER "$ENV{PATH}" path)
+ if(NOT path MATCHES "/mingw/bin")
+ if(UNIX)
+ set(sep ":")
+ set(mingw_bin "/mingw/bin")
+ else()
+ set(sep ";")
+ set(mingw_bin "C:/MinGW/bin")
+ endif()
+ set(ENV{PATH} "$ENV{PATH}${sep}${mingw_bin}")
+ message(STATUS "info: appending '${sep}${mingw_bin}' to the PATH")
+ endif()
+ endif()
+endif()
+
# First setup a source tree to run CMake on.
#
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory