diff options
author | Brad King <brad.king@kitware.com> | 2019-06-17 11:58:52 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-06-17 11:59:00 (GMT) |
commit | 805cb43d3e82630b8489b6bdb6cb46bc2178fa96 (patch) | |
tree | c3470e0daf422b74151b5424f87b07dcf9ffcecd /Tests | |
parent | 8f8b95395d70f8f58963f5285a32c86ed932bf4e (diff) | |
parent | 22e65d10c175081ed5f21f86c7064c014fc3f39c (diff) | |
download | CMake-805cb43d3e82630b8489b6bdb6cb46bc2178fa96.zip CMake-805cb43d3e82630b8489b6bdb6cb46bc2178fa96.tar.gz CMake-805cb43d3e82630b8489b6bdb6cb46bc2178fa96.tar.bz2 |
Merge topic 'find_package_prefer_config_fix'
22e65d10c1 find_package: Fixed CMAKE_FIND_PACKAGE_PREFER_CONFIG Module fallback
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3446
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/FindPackageTest/CMakeLists.txt | 13 | ||||
-rw-r--r-- | Tests/FindPackageTest/PreferConfigOnlyModule/FindACME.cmake | 1 |
2 files changed, 14 insertions, 0 deletions
diff --git a/Tests/FindPackageTest/CMakeLists.txt b/Tests/FindPackageTest/CMakeLists.txt index 8802b73..affe5d5 100644 --- a/Tests/FindPackageTest/CMakeLists.txt +++ b/Tests/FindPackageTest/CMakeLists.txt @@ -579,3 +579,16 @@ endif() set(CMAKE_FIND_PACKAGE_PREFER_CONFIG OFF) set(CMAKE_PREFIX_PATH) + +############################################################################ +##Test find_package CMAKE_FIND_PACKAGE_PREFER_CONFIG with module fallback + +set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/PreferConfigOnlyModule) + +set(CMAKE_FIND_PACKAGE_PREFER_CONFIG ON) + +find_package(ACME REQUIRED) + +if(NOT ACME_FOUND) + message(SEND_ERROR "Did not find ACME package") +endif() diff --git a/Tests/FindPackageTest/PreferConfigOnlyModule/FindACME.cmake b/Tests/FindPackageTest/PreferConfigOnlyModule/FindACME.cmake new file mode 100644 index 0000000..7a4e1b3 --- /dev/null +++ b/Tests/FindPackageTest/PreferConfigOnlyModule/FindACME.cmake @@ -0,0 +1 @@ +set(ACME_FOUND TRUE) |