This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake".
The branch, next has been updated via 14a6e2c81aec1b5761f159c35f93c6c84f9dfbcd (commit) via 9fc7ea4c620e849a719ea23ea6faff17f1d67ee6 (commit) from 0f92762c872cf4896b594e09da3d99ea26a432d1 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=14a6e2c81aec1b5761f159c35f93c6c84f9dfbcd commit 14a6e2c81aec1b5761f159c35f93c6c84f9dfbcd Merge: 0f92762 9fc7ea4 Author: Brad King <brad.k...@kitware.com> AuthorDate: Thu Apr 7 15:36:54 2011 -0400 Commit: CMake Topic Stage <kwro...@kitware.com> CommitDate: Thu Apr 7 15:36:54 2011 -0400 Merge topic 'find_package-forward-components' into next 9fc7ea4 find_package: Forward component list for recursive calls in modules http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9fc7ea4c620e849a719ea23ea6faff17f1d67ee6 commit 9fc7ea4c620e849a719ea23ea6faff17f1d67ee6 Author: Brad King <brad.k...@kitware.com> AuthorDate: Thu Apr 7 15:36:05 2011 -0400 Commit: Brad King <brad.k...@kitware.com> CommitDate: Thu Apr 7 15:36:05 2011 -0400 find_package: Forward component list for recursive calls in modules Some find modules call find_package recursively to locate a package configuration file for the package instead of searching for individual pieces. Commit 79e9b755 (Help recursive find_package calls in modules, 2008-10-03) taught find_package to forward the version number and EXACT arguments through the recursive call automatically. Do the same for the component list. diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index fdc1a01..d3c4bc7 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -101,9 +101,10 @@ void cmFindPackageCommand::GenerateDocumentation() "The [version] argument requests a version with which the package found " "should be compatible (format is major[.minor[.patch[.tweak]]]). " "The EXACT option requests that the version be matched exactly. " - "If no [version] is given to a recursive invocation inside a " - "find-module, the [version] and EXACT arguments are forwarded " - "automatically from the outer call. " + "If no [version] and/or component list is given to a recursive " + "invocation inside a find-module, the corresponding arguments " + "are forwarded automatically from the outer call (including the " + "EXACT flag for [version]). " "Version support is currently provided only on a package-by-package " "basis (details below).\n" "User code should generally look for packages using the above simple " @@ -524,7 +525,7 @@ bool cmFindPackageCommand cmake::AUTHOR_WARNING, "Ignoring EXACT since no version is requested."); } - if(this->Version.empty()) + if(this->Version.empty() || components.empty()) { // Check whether we are recursing inside "Find<name>.cmake" within // another find_package(<name>) call. @@ -532,16 +533,24 @@ bool cmFindPackageCommand mod += "_FIND_MODULE"; if(this->Makefile->IsOn(mod.c_str())) { - // Get version information from the outer call if necessary. - // Requested version string. - std::string ver = this->Name; - ver += "_FIND_VERSION"; - this->Version = this->Makefile->GetSafeDefinition(ver.c_str()); - - // Whether an exact version is required. - std::string exact = this->Name; - exact += "_FIND_VERSION_EXACT"; - this->VersionExact = this->Makefile->IsOn(exact.c_str()); + if(this->Version.empty()) + { + // Get version information from the outer call if necessary. + // Requested version string. + std::string ver = this->Name; + ver += "_FIND_VERSION"; + this->Version = this->Makefile->GetSafeDefinition(ver.c_str()); + + // Whether an exact version is required. + std::string exact = this->Name; + exact += "_FIND_VERSION_EXACT"; + this->VersionExact = this->Makefile->IsOn(exact.c_str()); + } + if(components.empty()) + { + std::string components_var = this->Name + "_FIND_COMPONENTS"; + components = this->Makefile->GetSafeDefinition(components_var.c_str()); + } } } diff --git a/Tests/FindPackageTest/CMakeLists.txt b/Tests/FindPackageTest/CMakeLists.txt index f420f4b..d4984d7 100644 --- a/Tests/FindPackageTest/CMakeLists.txt +++ b/Tests/FindPackageTest/CMakeLists.txt @@ -105,7 +105,7 @@ FIND_PACKAGE(wibbleA NAMES wibble PATHS B) FIND_PACKAGE(wibbleB NAMES wibble HINTS B) # Look for package with recursive find-modules. -FIND_PACKAGE(RecursiveA) +FIND_PACKAGE(RecursiveA COMPONENTS A) FIND_PACKAGE(RecursiveB 2) FIND_PACKAGE(RecursiveC 3.1 EXACT) diff --git a/Tests/FindPackageTest/lib/RecursiveA/recursivea-config.cmake b/Tests/FindPackageTest/lib/RecursiveA/recursivea-config.cmake index deffa57..eff4d4f 100644 --- a/Tests/FindPackageTest/lib/RecursiveA/recursivea-config.cmake +++ b/Tests/FindPackageTest/lib/RecursiveA/recursivea-config.cmake @@ -1 +1,4 @@ # Test config file. +if(NOT "${RecursiveA_FIND_COMPONENTS}" STREQUAL "A") + message(FATAL_ERROR "find_package(RecursiveA NO_MODULE) did not forward components") +endif() ----------------------------------------------------------------------- Summary of changes: Source/cmFindPackageCommand.cxx | 35 ++++++++++++------- Tests/FindPackageTest/CMakeLists.txt | 2 +- .../lib/RecursiveA/recursivea-config.cmake | 3 ++ 3 files changed, 26 insertions(+), 14 deletions(-) hooks/post-receive -- CMake _______________________________________________ Cmake-commits mailing list Cmake-commits@cmake.org http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-commits