diff --git a/Help/manual/cmake-configure-log.7.rst b/Help/manual/cmake-configure-log.7.rst index f87940693a..6acc8496b4 100644 --- a/Help/manual/cmake-configure-log.7.rst +++ b/Help/manual/cmake-configure-log.7.rst @@ -654,7 +654,8 @@ The keys specific to ``find_package-v1`` mappings are: keys: ``path`` - The path to the considered file. + The path to the considered file. In the case of a dependency provider, the + value is in the form of ``dependency_provider::``. ``mode`` The mode which found the file. One of ``module``, ``cps``, ``cmake``, or @@ -673,7 +674,9 @@ The keys specific to ``find_package-v1`` mappings are: found, this is ``null``. Keys available: ``path`` - The path to the module or configuration that found the package. + The path to the module or configuration that found the package. In the + case of a dependency provider, the value is in the form of + ``dependency_provider::``. ``mode`` The mode that considered the path. One of ``module``, ``cps``, ``cmake``, diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index a2a71bd9e2..ebecd9d572 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -1121,13 +1121,24 @@ bool cmFindPackageCommand::FindPackage( if (!providerCommand(listFileArgs, this->Status)) { return false; } + std::string providerName; + if (auto depProvider = state->GetDependencyProvider()) { + providerName = depProvider->GetCommand(); + } else { + providerName = ""; + } + auto searchPath = cmStrCat("dependency_provider::", providerName); if (this->Makefile->IsOn(cmStrCat(this->Name, "_FOUND"))) { if (this->DebugModeEnabled()) { this->DebugMessage("Package was found by the dependency provider"); } + this->FileFound = searchPath; + this->FileFoundMode = FoundPackageMode::Provider; this->AppendSuccessInformation(); return true; } + this->ConsideredPaths.emplace_back(searchPath, FoundPackageMode::Provider, + SearchResult::NotFound); } // Limit package nesting depth well below the recursion depth limit because