summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@crascit.com>2019-07-09 23:32:40 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-07-09 23:32:54 (GMT)
commitf7eb76501224a028c2e2bcacaef6018ece7b3738 (patch)
treea9789c4759728e3fd3a3c634bfdd567d4907e5de /Tests
parentf374ffb14b3e55bbee8e7bb0eb3e5a33ee3612f1 (diff)
parent447a96f5905ed1fb0ef17a8732cac7014da99cf6 (diff)
downloadCMake-f7eb76501224a028c2e2bcacaef6018ece7b3738.zip
CMake-f7eb76501224a028c2e2bcacaef6018ece7b3738.tar.gz
CMake-f7eb76501224a028c2e2bcacaef6018ece7b3738.tar.bz2
Merge topic 'add_cmake_find_use_package_registry'
447a96f590 vim: Update cmake.vim to include the CMAKE_FIND_USE variables 1d00ba9ccf Find: find_package prefers variable CMAKE_FIND_USE_REGISTRY 704e3a2ca8 Find: Correct spelling and layout issues in CMAKE_FIND_USE_ docs Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3487
Diffstat (limited to 'Tests')
-rw-r--r--Tests/FindPackageTest/CMakeLists.txt34
-rw-r--r--Tests/RunCMake/find_program/RelAndAbsPath.cmake2
2 files changed, 32 insertions, 4 deletions
diff --git a/Tests/FindPackageTest/CMakeLists.txt b/Tests/FindPackageTest/CMakeLists.txt
index affe5d5..2f0c051 100644
--- a/Tests/FindPackageTest/CMakeLists.txt
+++ b/Tests/FindPackageTest/CMakeLists.txt
@@ -391,16 +391,44 @@ try_compile(EXPORTER_COMPILED
message(STATUS "Searching for export(PACKAGE) test project")
set(CMakeTestExportPackage_DIR "" CACHE FILEPATH
"Wipe out find results for testing." FORCE)
+
+message(STATUS "Searching for export(PACKAGE) with CMAKE_FIND_USE_PACKAGE_REGISTRY=TRUE")
+set(CMAKE_FIND_USE_PACKAGE_REGISTRY TRUE)
+find_package(CMakeTestExportPackage 1.${version} EXACT REQUIRED)
+if(NOT CMakeTestExportPackage_FOUND)
+ message(SEND_ERROR "CMakeTestExportPackage should be FOUND!")
+endif()
+unset(CMAKE_FIND_USE_PACKAGE_REGISTRY)
+
+message(STATUS "Searching for export(PACKAGE) with CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=FALSE")
+set(CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY FALSE)
find_package(CMakeTestExportPackage 1.${version} EXACT REQUIRED)
+if(NOT CMakeTestExportPackage_FOUND)
+ message(SEND_ERROR "CMakeTestExportPackage should be FOUND!")
+endif()
+unset(CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY)
-message(STATUS "Searching for export(PACKAGE) test project with CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=TRUE")
+message(STATUS "Searching for export(PACKAGE) with CMAKE_FIND_USE_PACKAGE_REGISTRY=TRUE and CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=TRUE")
+set(CMAKE_FIND_USE_PACKAGE_REGISTRY TRUE)
set(CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY TRUE)
+set(CMakeTestExportPackage_DIR FALSE)
+find_package(CMakeTestExportPackage 1.${version} EXACT REQUIRED)
+if(NOT CMakeTestExportPackage_FOUND)
+ message(SEND_ERROR "CMakeTestExportPackage should be FOUND!")
+endif()
+unset(CMAKE_FIND_USE_PACKAGE_REGISTRY)
+unset(CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY)
+
+message(STATUS "Searching for export(PACKAGE) with CMAKE_FIND_USE_PACKAGE_REGISTRY=FALSE and CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=FALSE")
+set(CMAKE_FIND_USE_PACKAGE_REGISTRY FALSE)
+set(CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY FALSE)
set(CMakeTestExportPackage_DIR "" CACHE FILEPATH
"Wipe out find results for testing." FORCE)
-find_package(CMakeTestExportPackage 1.${version} EXACT QUIET)
+find_package(CMakeTestExportPackage 1.${version} EXACT QUIET)
if(CMakeTestExportPackage_FOUND)
- message(SEND_ERROR "CMakeTestExportPackage should not be FOUND!")
+ message(SEND_ERROR "CMakeTestExportPackage should be not FOUND!")
endif()
+unset(CMAKE_FIND_USE_PACKAGE_REGISTRY)
unset(CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY)
message(STATUS "Remove export(PACKAGE) test project")
diff --git a/Tests/RunCMake/find_program/RelAndAbsPath.cmake b/Tests/RunCMake/find_program/RelAndAbsPath.cmake
index e6bdef7..3c60a20 100644
--- a/Tests/RunCMake/find_program/RelAndAbsPath.cmake
+++ b/Tests/RunCMake/find_program/RelAndAbsPath.cmake
@@ -46,7 +46,7 @@ set(CMAKE_PREFIX_PATH ".")
set(CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH OFF)
set(CMAKE_FIND_USE_CMAKE_PATH OFF)
set(CMAKE_FIND_USE_CMAKE_SYSTEM_PATH OFF)
-set(CMAKE_FIND_USE_PACAKGE_ROOT_PATH OFF)
+set(CMAKE_FIND_USE_PACKAGE_ROOT_PATH OFF)
set(CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH OFF)
find_program(PROG_CWD
NAMES testCWD