diff options
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) |