Merge topic 'FeatureSummary-no-transitive'
a6971f65
FeatureSummary: Don't list transitive package dependencies
This commit is contained in:
commit
43a78f5b29
|
@ -45,7 +45,16 @@ macro(find_dependency dep)
|
|||
set(required_arg REQUIRED)
|
||||
endif()
|
||||
|
||||
get_property(alreadyTransitive GLOBAL PROPERTY
|
||||
_CMAKE_${dep}_TRANSITIVE_DEPENDENCY
|
||||
)
|
||||
|
||||
find_package(${dep} ${version} ${exact_arg} ${quiet_arg} ${required_arg})
|
||||
|
||||
if(NOT DEFINED alreadyTransitive OR alreadyTransitive)
|
||||
set_property(GLOBAL PROPERTY _CMAKE_${dep}_TRANSITIVE_DEPENDENCY TRUE)
|
||||
endif()
|
||||
|
||||
if (NOT ${dep}_FOUND)
|
||||
set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE "${CMAKE_FIND_PACKAGE_NAME} could not be found because dependency ${dep} could not be found.")
|
||||
set(${CMAKE_FIND_PACKAGE_NAME}_FOUND False)
|
||||
|
|
|
@ -376,6 +376,12 @@ function(_FS_GET_FEATURE_SUMMARY _property _var _includeQuiet)
|
|||
set(includeThisOne FALSE)
|
||||
endif()
|
||||
endif()
|
||||
get_property(_isTransitiveDepend
|
||||
GLOBAL PROPERTY _CMAKE_${_currentFeature}_TRANSITIVE_DEPENDENCY
|
||||
)
|
||||
if(_isTransitiveDepend)
|
||||
set(includeThisOne FALSE)
|
||||
endif()
|
||||
|
||||
if(includeThisOne)
|
||||
|
||||
|
|
|
@ -1043,6 +1043,12 @@ void cmFindPackageCommand::AppendToFoundProperty(bool found)
|
|||
//----------------------------------------------------------------------------
|
||||
void cmFindPackageCommand::AppendSuccessInformation()
|
||||
{
|
||||
{
|
||||
std::string transitivePropName = "_CMAKE_";
|
||||
transitivePropName += this->Name + "_TRANSITIVE_DEPENDENCY";
|
||||
this->Makefile->GetCMakeInstance()
|
||||
->SetProperty(transitivePropName.c_str(), "False");
|
||||
}
|
||||
std::string found = this->Name;
|
||||
found += "_FOUND";
|
||||
std::string upperFound = cmSystemTools::UpperCase(found);
|
||||
|
|
Loading…
Reference in New Issue