diff options
Diffstat (limited to 'Source/cmFindPackageCommand.cxx')
-rw-r--r-- | Source/cmFindPackageCommand.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index 828488f..1d4a8ed 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -823,8 +823,9 @@ bool cmFindPackageCommand::HandlePackageMode( } } - if (this->Makefile->IsOn("CMAKE_FIND_PACKAGE_PREFER_CONFIG") && !found && - handlePackageModeType == HandlePackageModeType::Config) { + if (this->UseFindModules && !found && + handlePackageModeType == HandlePackageModeType::Config && + this->Makefile->IsOn("CMAKE_FIND_PACKAGE_PREFER_CONFIG")) { // Config mode failed. Allow Module case. result = false; } |