diff options
author | Brad King <brad.king@kitware.com> | 2014-02-05 14:34:23 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2014-02-05 14:34:23 (GMT) |
commit | 43a78f5b295fb68012e41ebe32b8d78fca63261f (patch) | |
tree | fd0a8cb5b1785b1766e951f6cdba58a41b091393 | |
parent | 2233ddf5ae7c178528def572e8f6040ebcec4c36 (diff) | |
parent | a6971f6510e532b10f6548f0b77592f41faba38f (diff) | |
download | CMake-43a78f5b295fb68012e41ebe32b8d78fca63261f.zip CMake-43a78f5b295fb68012e41ebe32b8d78fca63261f.tar.gz CMake-43a78f5b295fb68012e41ebe32b8d78fca63261f.tar.bz2 |
Merge topic 'FeatureSummary-no-transitive'
a6971f65 FeatureSummary: Don't list transitive package dependencies
-rw-r--r-- | Modules/CMakeFindDependencyMacro.cmake | 9 | ||||
-rw-r--r-- | Modules/FeatureSummary.cmake | 6 | ||||
-rw-r--r-- | Source/cmFindPackageCommand.cxx | 6 |
3 files changed, 21 insertions, 0 deletions
diff --git a/Modules/CMakeFindDependencyMacro.cmake b/Modules/CMakeFindDependencyMacro.cmake index 596c6fc..0f1f56d 100644 --- a/Modules/CMakeFindDependencyMacro.cmake +++ b/Modules/CMakeFindDependencyMacro.cmake @@ -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) diff --git a/Modules/FeatureSummary.cmake b/Modules/FeatureSummary.cmake index b0f8e16..c0e63d5 100644 --- a/Modules/FeatureSummary.cmake +++ b/Modules/FeatureSummary.cmake @@ -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) diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index c59aafd..73eba51 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -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); |