diff options
author | Brad King <brad.king@kitware.com> | 2019-06-17 11:59:46 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-06-17 11:59:46 (GMT) |
commit | 3d8216330da76bac8267d64d4940af0b05e502a9 (patch) | |
tree | f80f68c8c6d1d2fc50e7445c4d9101d24acdebac /Tests | |
parent | e815fad43f46c9145510972aef2d706b1c8a05d2 (diff) | |
parent | 22e65d10c175081ed5f21f86c7064c014fc3f39c (diff) | |
download | CMake-3d8216330da76bac8267d64d4940af0b05e502a9.zip CMake-3d8216330da76bac8267d64d4940af0b05e502a9.tar.gz CMake-3d8216330da76bac8267d64d4940af0b05e502a9.tar.bz2 |
Merge branch 'find_package_prefer_config_fix' into release-3.15
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) |