diff options
author | Brad King <brad.king@kitware.com> | 2019-08-06 13:43:25 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-08-06 13:43:25 (GMT) |
commit | 9a384e73044f4295a50c8923389b1de832cee36a (patch) | |
tree | 7e349e0cbfc504ae659e6407f46c3de0263fea0a | |
parent | 1c3404a301959690ca967b0c751c0df1f57a1ecd (diff) | |
parent | 8ed868606ddae005b4a50319bdc291b8df5b525a (diff) | |
download | CMake-9a384e73044f4295a50c8923389b1de832cee36a.zip CMake-9a384e73044f4295a50c8923389b1de832cee36a.tar.gz CMake-9a384e73044f4295a50c8923389b1de832cee36a.tar.bz2 |
Merge branch 'find_package-prefer-config-not-found' into release-3.15
Merge-request: !3653
-rw-r--r-- | Source/cmFindPackageCommand.cxx | 4 | ||||
-rw-r--r-- | Tests/FindPackageTest/CMakeLists.txt | 6 |
2 files changed, 9 insertions, 1 deletions
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index 1d4a8ed..171fa77 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -507,7 +507,9 @@ bool cmFindPackageCommand::InitialPass(std::vector<std::string> const& args, loadedPackage = true; } else { // The package was not loaded. Report errors. - HandlePackageMode(HandlePackageModeType::Module); + if (HandlePackageMode(HandlePackageModeType::Module)) { + loadedPackage = true; + } } } } else { diff --git a/Tests/FindPackageTest/CMakeLists.txt b/Tests/FindPackageTest/CMakeLists.txt index da79f5d..1b9c973 100644 --- a/Tests/FindPackageTest/CMakeLists.txt +++ b/Tests/FindPackageTest/CMakeLists.txt @@ -625,3 +625,9 @@ find_package(ACME NO_MODULE) if(ACME_FOUND) message(SEND_ERROR "Should not find ACME package") endif() + +############################################################################ +##Test find_package CMAKE_FIND_PACKAGE_PREFER_CONFIG with unknown package + +set(CMAKE_FIND_PACKAGE_PREFER_CONFIG ON) +find_package(DoesNotExist) |