summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-02-01 17:04:21 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-02-01 17:04:33 (GMT)
commitc138ddb94319832972466cf6e7a7984bde54abe0 (patch)
tree0866918ad96330cbe4841103014e53036cfd89dc /Tests
parent012ea11ea4ace409fb1086da55652d87e852403c (diff)
parent11f97d196880e78717211ab68138e9ff922ec826 (diff)
downloadCMake-c138ddb94319832972466cf6e7a7984bde54abe0.zip
CMake-c138ddb94319832972466cf6e7a7984bde54abe0.tar.gz
CMake-c138ddb94319832972466cf6e7a7984bde54abe0.tar.bz2
Merge topic 'refactor-find-package-cmake-ignore-path'
11f97d1968 find_package(): Refactor CMAKE_[SYSTEM_]IGNORE_PATH 30e5c1d92b find_package(): Add tests for CMAKE_IGNORE_PATH Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Merge-request: !6918
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/find_package/IgnorePath.cmake12
-rw-r--r--Tests/RunCMake/find_package/RunCMakeTest.cmake1
2 files changed, 13 insertions, 0 deletions
diff --git a/Tests/RunCMake/find_package/IgnorePath.cmake b/Tests/RunCMake/find_package/IgnorePath.cmake
new file mode 100644
index 0000000..f40549b
--- /dev/null
+++ b/Tests/RunCMake/find_package/IgnorePath.cmake
@@ -0,0 +1,12 @@
+set(CMAKE_PREFIX_PATH
+ ${CMAKE_SOURCE_DIR}/PackageRoot/foo/cmake_root
+ ${CMAKE_SOURCE_DIR}/PackageRoot/foo/env_root
+ )
+set(CMAKE_IGNORE_PATH
+ ${CMAKE_SOURCE_DIR}/PackageRoot//foo/cmake_root// # Test double slashes
+ ${CMAKE_SOURCE_DIR}/PackageRoot/foo/env_root/cmake
+ )
+find_package(Bar QUIET CONFIG)
+if(Bar_FOUND)
+ message(FATAL_ERROR "Bar should not be found, was found in ${Bar_DIR}")
+endif()
diff --git a/Tests/RunCMake/find_package/RunCMakeTest.cmake b/Tests/RunCMake/find_package/RunCMakeTest.cmake
index 2bace98..12701dc 100644
--- a/Tests/RunCMake/find_package/RunCMakeTest.cmake
+++ b/Tests/RunCMake/find_package/RunCMakeTest.cmake
@@ -44,6 +44,7 @@ run_cmake(VersionRangeConfig2)
run_cmake(VersionRangeConfig02)
run_cmake(VersionRangeConfigStd)
run_cmake(VersionRangeConfigStd2)
+run_cmake(IgnorePath)
if(UNIX
AND NOT MSYS # FIXME: This works on CYGWIN but not on MSYS
)