Commit 9a384e73 authored by Brad King's avatar Brad King
Browse files

Merge branch 'find_package-prefer-config-not-found' into release-3.15

Merge-request: !3653
parents 1c3404a3 8ed86860
...@@ -507,7 +507,9 @@ bool cmFindPackageCommand::InitialPass(std::vector<std::string> const& args, ...@@ -507,7 +507,9 @@ bool cmFindPackageCommand::InitialPass(std::vector<std::string> const& args,
loadedPackage = true; loadedPackage = true;
} else { } else {
// The package was not loaded. Report errors. // The package was not loaded. Report errors.
HandlePackageMode(HandlePackageModeType::Module); if (HandlePackageMode(HandlePackageModeType::Module)) {
loadedPackage = true;
}
} }
} }
} else { } else {
......
...@@ -625,3 +625,9 @@ find_package(ACME NO_MODULE) ...@@ -625,3 +625,9 @@ find_package(ACME NO_MODULE)
if(ACME_FOUND) if(ACME_FOUND)
message(SEND_ERROR "Should not find ACME package") message(SEND_ERROR "Should not find ACME package")
endif() endif()
############################################################################
##Test find_package CMAKE_FIND_PACKAGE_PREFER_CONFIG with unknown package
set(CMAKE_FIND_PACKAGE_PREFER_CONFIG ON)
find_package(DoesNotExist)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment