summaryrefslogtreecommitdiffstats
path: root/Tests/FindPackageTest
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2010-08-12 22:20:47 (GMT)
committerBrad King <brad.king@kitware.com>2010-08-13 15:53:28 (GMT)
commit1221581aa8de2b4bb06e09894940dba6ff90caa1 (patch)
tree0b2559f8f54e203d189056464c48e8d096ab73da /Tests/FindPackageTest
parent7b632e5ac62cb2af74025b71660a1c5822fcfc39 (diff)
downloadCMake-1221581aa8de2b4bb06e09894940dba6ff90caa1.zip
CMake-1221581aa8de2b4bb06e09894940dba6ff90caa1.tar.gz
CMake-1221581aa8de2b4bb06e09894940dba6ff90caa1.tar.bz2
Teach find_* commands to ignore some paths
Add platform configuration variable CMAKE_SYSTEM_IGNORE_PATH and user configuration variable CMAKE_IGNORE_PATH. These specify a set of directories that will be ignored by all the find commands. Update FindPackageTest so that several cases will fail without a functioning CMAKE_IGNORE_PATH.
Diffstat (limited to 'Tests/FindPackageTest')
-rw-r--r--Tests/FindPackageTest/CMakeLists.txt4
-rw-r--r--Tests/FindPackageTest/lib/cmake/zot-3.1/zot-config-version.cmake4
-rw-r--r--Tests/FindPackageTest/lib/cmake/zot-3.1/zot-config.cmake2
3 files changed, 10 insertions, 0 deletions
diff --git a/Tests/FindPackageTest/CMakeLists.txt b/Tests/FindPackageTest/CMakeLists.txt
index 74cc115..a472bea 100644
--- a/Tests/FindPackageTest/CMakeLists.txt
+++ b/Tests/FindPackageTest/CMakeLists.txt
@@ -54,6 +54,10 @@ SET(CMAKE_FIND_APPBUNDLE FIRST)
# Set the wrong answer for a find to make sure it re-finds.
set(VersionedA_DIR ${CMAKE_CURRENT_SOURCE_DIR}/lib/cmake/zot-4.0)
+# Test that CMAKE_IGNORE_PATH can ignore the purposely bad package
+# files in the lib/cmake/zot-3.1 directory.
+set(CMAKE_IGNORE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/lib/cmake/zot-3.1)
+
# Look for packages with new-style signatures.
FIND_PACKAGE(foo NO_MODULE)
FIND_PACKAGE(Foo CONFIGS FooConfig.cmake)
diff --git a/Tests/FindPackageTest/lib/cmake/zot-3.1/zot-config-version.cmake b/Tests/FindPackageTest/lib/cmake/zot-3.1/zot-config-version.cmake
new file mode 100644
index 0000000..bee2f0e
--- /dev/null
+++ b/Tests/FindPackageTest/lib/cmake/zot-3.1/zot-config-version.cmake
@@ -0,0 +1,4 @@
+# Claim to be any version to test that CMAKE_IGNORE_PATH hides us.
+SET(PACKAGE_VERSION 3.1)
+SET(PACKAGE_VERSION_COMPATIBLE 1)
+SET(PACKAGE_VERSION_EXACT 1)
diff --git a/Tests/FindPackageTest/lib/cmake/zot-3.1/zot-config.cmake b/Tests/FindPackageTest/lib/cmake/zot-3.1/zot-config.cmake
new file mode 100644
index 0000000..2fbd525
--- /dev/null
+++ b/Tests/FindPackageTest/lib/cmake/zot-3.1/zot-config.cmake
@@ -0,0 +1,2 @@
+# Test config file.
+message(WARNING "CMAKE_IGNORE_PATH failed to ignore this file!")