Commit ce14f6c6 authored by Brad King's avatar Brad King Committed by Kitware Robot
Browse files

Merge topic 'find_package-prefer-config-not-found'

8ed86860

 find_package: Fix prefer-config mode to not fail on missing optional package
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !3653
parents e295290e 8ed86860
......@@ -517,7 +517,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 {
......
......@@ -653,3 +653,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)
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