diff options
Diffstat (limited to 'Tests/FindPackageTest')
-rw-r--r-- | Tests/FindPackageTest/CMakeLists.txt | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/Tests/FindPackageTest/CMakeLists.txt b/Tests/FindPackageTest/CMakeLists.txt index da79f5d..519608c 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") |