summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/find_package/IgnoreInstallPrefix.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake/find_package/IgnoreInstallPrefix.cmake')
-rw-r--r--Tests/RunCMake/find_package/IgnoreInstallPrefix.cmake17
1 files changed, 17 insertions, 0 deletions
diff --git a/Tests/RunCMake/find_package/IgnoreInstallPrefix.cmake b/Tests/RunCMake/find_package/IgnoreInstallPrefix.cmake
new file mode 100644
index 0000000..ee40d88
--- /dev/null
+++ b/Tests/RunCMake/find_package/IgnoreInstallPrefix.cmake
@@ -0,0 +1,17 @@
+
+find_package(Bar QUIET CONFIG NO_CMAKE_INSTALL_PREFIX)
+if(Bar_FOUND)
+ message(SEND_ERROR "Bar should not be found, was found in ${Bar_DIR}")
+endif()
+
+set(CMAKE_FIND_USE_INSTALL_PREFIX OFF)
+find_package(Bar QUIET CONFIG)
+if(Bar_FOUND)
+ message(SEND_ERROR "Bar should not be found, was found in ${Bar_DIR}")
+endif()
+
+set(CMAKE_FIND_USE_INSTALL_PREFIX ON)
+find_package(Bar QUIET CONFIG)
+if(NOT Bar_FOUND)
+ message(SEND_ERROR "Bar should be found via CMAKE_INSTALL_PREFIX")
+endif()