diff options
author | Brad King <brad.king@kitware.com> | 2019-03-15 14:45:39 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-03-15 14:45:51 (GMT) |
commit | 3261f2387038e251d25852069f0ffc6fb81ed0a0 (patch) | |
tree | cad862584e7da75467d5ec0070b3dc5c55980e6f /Tests | |
parent | a6d8165dd2abe81dd133d188c8fe81323944c469 (diff) | |
parent | 9bede5c4cecd71fba7ce6a0687c4a68e1c84a54b (diff) | |
download | CMake-3261f2387038e251d25852069f0ffc6fb81ed0a0.zip CMake-3261f2387038e251d25852069f0ffc6fb81ed0a0.tar.gz CMake-3261f2387038e251d25852069f0ffc6fb81ed0a0.tar.bz2 |
Merge topic 'export-package-default-off'
9bede5c4ce export: Disable PACKAGE mode user package registry by default
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Lukas Mosimann <lumosimann@gmail.com>
Merge-request: !3041
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/FindPackageTest/CMakeLists.txt | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Tests/FindPackageTest/CMakeLists.txt b/Tests/FindPackageTest/CMakeLists.txt index f8b36c5..972580c 100644 --- a/Tests/FindPackageTest/CMakeLists.txt +++ b/Tests/FindPackageTest/CMakeLists.txt @@ -380,6 +380,7 @@ try_compile(EXPORTER_COMPILED ${FindPackageTest_SOURCE_DIR}/Exporter CMakeTestExportPackage dummy CMAKE_FLAGS "-UCMAKE_EXPORT_NO_PACKAGE_REGISTRY" + "-DCMAKE_POLICY_DEFAULT_CMP0090:STRING=OLD" -Dversion=${version} OUTPUT_VARIABLE output) message(STATUS "Searching for export(PACKAGE) test project") @@ -417,6 +418,25 @@ if(CMakeTestExportPackage_FOUND) message(SEND_ERROR "CMakeTestExportPackage should not be FOUND!") endif() +message(STATUS "Remove export(PACKAGE) test project") +file(REMOVE_RECURSE ${FindPackageTest_BINARY_DIR}/Exporter-build) + +message(STATUS "Preparing export(PACKAGE) test project with POLICY CMP0090=NEW") +try_compile(EXPORTER_COMPILED + ${FindPackageTest_BINARY_DIR}/Exporter-build + ${FindPackageTest_SOURCE_DIR}/Exporter + CMakeTestExportPackage dummy + CMAKE_FLAGS + "-DCMAKE_POLICY_DEFAULT_CMP0090:STRING=NEW" + -Dversion=${version} + OUTPUT_VARIABLE output) +message(STATUS "Searching for export(PACKAGE) test project") +find_package(CMakeTestExportPackage 1.${version} EXACT QUIET) +if(CMakeTestExportPackage_FOUND) + message(SEND_ERROR "CMakeTestExportPackage should not be FOUND!") +endif() + + #----------------------------------------------------------------------------- # Test configure_package_config_file(). |