diff options
author | Cristian Adam <cristian.adam@gmail.com> | 2019-07-16 08:42:00 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-07-16 13:09:24 (GMT) |
commit | f2edccea666662ce93af29e397c50702a675f3f4 (patch) | |
tree | a0a94a1ed1f1e965a5b61a79f107a820e6383851 /Tests/FindPackageTest/PreferConfigRecurse | |
parent | 86ead0b5a32ee48907084a7cf85d00196cbf0366 (diff) | |
download | CMake-f2edccea666662ce93af29e397c50702a675f3f4.zip CMake-f2edccea666662ce93af29e397c50702a675f3f4.tar.gz CMake-f2edccea666662ce93af29e397c50702a675f3f4.tar.bz2 |
find_package: Fix NO_MODULE under CMAKE_FIND_PACKAGE_PREFER_CONFIG
The module mode fallback added by commit 22e65d10c1 (find_package: Fixed
CMAKE_FIND_PACKAGE_PREFER_CONFIG Module fallback, 2019-06-13,
v3.15.0-rc2~6^2) should not be used unless the `find_package` call
allows module mode. Doing so can lead to infinite recursion if a find
module tries to call config mode with `find_package(... NO_MODULE)`.
Fix the logic and add a test case.
Fixes: #19478
Diffstat (limited to 'Tests/FindPackageTest/PreferConfigRecurse')
-rw-r--r-- | Tests/FindPackageTest/PreferConfigRecurse/ACMEConfig.cmake | 1 | ||||
-rw-r--r-- | Tests/FindPackageTest/PreferConfigRecurse/FindACME.cmake | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/Tests/FindPackageTest/PreferConfigRecurse/ACMEConfig.cmake b/Tests/FindPackageTest/PreferConfigRecurse/ACMEConfig.cmake new file mode 100644 index 0000000..7a4e1b3 --- /dev/null +++ b/Tests/FindPackageTest/PreferConfigRecurse/ACMEConfig.cmake @@ -0,0 +1 @@ +set(ACME_FOUND TRUE) diff --git a/Tests/FindPackageTest/PreferConfigRecurse/FindACME.cmake b/Tests/FindPackageTest/PreferConfigRecurse/FindACME.cmake new file mode 100644 index 0000000..9bdc7db --- /dev/null +++ b/Tests/FindPackageTest/PreferConfigRecurse/FindACME.cmake @@ -0,0 +1 @@ +find_package(ACME NO_MODULE) |