diff options
author | Cristian Adam <cristian.adam@gmail.com> | 2019-06-13 21:58:30 (GMT) |
---|---|---|
committer | Cristian Adam <cristian.adam@gmail.com> | 2019-06-13 21:58:30 (GMT) |
commit | 22e65d10c175081ed5f21f86c7064c014fc3f39c (patch) | |
tree | a673d33900c33c132c1528072064cc1ec4970f57 /Tests/FindPackageTest/CMakeLists.txt | |
parent | a4231943117f5ba3dd0fdc6c8b1824334162b69f (diff) | |
download | CMake-22e65d10c175081ed5f21f86c7064c014fc3f39c.zip CMake-22e65d10c175081ed5f21f86c7064c014fc3f39c.tar.gz CMake-22e65d10c175081ed5f21f86c7064c014fc3f39c.tar.bz2 |
find_package: Fixed CMAKE_FIND_PACKAGE_PREFER_CONFIG Module fallback
Fixes: #19361
Diffstat (limited to 'Tests/FindPackageTest/CMakeLists.txt')
-rw-r--r-- | Tests/FindPackageTest/CMakeLists.txt | 13 |
1 files changed, 13 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() |