summaryrefslogtreecommitdiffstats
path: root/Tests/CMakeOnly/AllFindModules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-03-19 17:33:00 (GMT)
committerBrad King <brad.king@kitware.com>2014-03-19 17:33:00 (GMT)
commitcf3e87e195448af50a9b2f0ca02732756e82ff2f (patch)
treee7946c46bd4e9c0422e474082b8b208eed01c97c /Tests/CMakeOnly/AllFindModules
parent8b8691adcad725e365407118d6d282994efad152 (diff)
downloadCMake-cf3e87e195448af50a9b2f0ca02732756e82ff2f.zip
CMake-cf3e87e195448af50a9b2f0ca02732756e82ff2f.tar.gz
CMake-cf3e87e195448af50a9b2f0ca02732756e82ff2f.tar.bz2
Tests: Teach CMakeOnly.AllFindModules to tolerate a system KDE4
The FindKDE4 module (incorrectly) modifies CMAKE_MODULE_PATH on the caller's behalf. This causes KDE4-installed find modules to be used by the test instead of those in CMake. Teach the test to restore the CMAKE_MODULE_PATH to its original value after each find_package call. This ensures that the next find_package actually tests our module.
Diffstat (limited to 'Tests/CMakeOnly/AllFindModules')
-rw-r--r--Tests/CMakeOnly/AllFindModules/CMakeLists.txt3
1 files changed, 3 insertions, 0 deletions
diff --git a/Tests/CMakeOnly/AllFindModules/CMakeLists.txt b/Tests/CMakeOnly/AllFindModules/CMakeLists.txt
index 691728a..15493be 100644
--- a/Tests/CMakeOnly/AllFindModules/CMakeLists.txt
+++ b/Tests/CMakeOnly/AllFindModules/CMakeLists.txt
@@ -8,11 +8,14 @@ endif ()
# Avoid ctest truncation of output
message(STATUS "CTEST_FULL_OUTPUT")
+set(ORIGINAL_MODULE_PATH "${CMAKE_MODULE_PATH}")
+
file(GLOB FIND_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../Modules/Find*.cmake" )
macro(do_find MODULE_NAME)
message(STATUS " Checking Find${MODULE_NAME}")
find_package(${MODULE_NAME})
+ set(CMAKE_MODULE_PATH "${ORIGINAL_MODULE_PATH}")
endmacro()
# It is only possible to use either Qt3 or Qt4 in one project.