summaryrefslogtreecommitdiffstats
path: root/Source/cmFindPackageCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-10-08 14:56:23 (GMT)
committerBrad King <brad.king@kitware.com>2008-10-08 14:56:23 (GMT)
commit25a5c34a62c50d4dc873c04d0896e3ba3e234f56 (patch)
tree54229ee90a4e37152ab561e6b66285b9afb5c3f9 /Source/cmFindPackageCommand.cxx
parenta5695eb7ac9649b76c9946f2dee51eb0f21a9eac (diff)
downloadCMake-25a5c34a62c50d4dc873c04d0896e3ba3e234f56.zip
CMake-25a5c34a62c50d4dc873c04d0896e3ba3e234f56.tar.gz
CMake-25a5c34a62c50d4dc873c04d0896e3ba3e234f56.tar.bz2
ENH: Remove implicit NO_MODULE when recursing
Recently we taught find_package that the NO_MODULE option is implied when it is recursively invoked in a find-module. This behavior may be confusing because two identical calls may enter different modes depending on context. It also disallows the possibility that one find-module defers to another find-module by changing CMAKE_MODULE_PATH and recursively invoking find_package. This change reverts the feature.
Diffstat (limited to 'Source/cmFindPackageCommand.cxx')
-rw-r--r--Source/cmFindPackageCommand.cxx36
1 files changed, 14 insertions, 22 deletions
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index bb47a36..c68e86c 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -91,6 +91,9 @@ cmFindPackageCommand::cmFindPackageCommand()
"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. "
"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 "
@@ -129,8 +132,7 @@ cmFindPackageCommand::cmFindPackageCommand()
" NO_CMAKE_FIND_ROOT_PATH])\n"
"The NO_MODULE option may be used to skip Module mode explicitly. "
"It is also implied by use of options not specified in the reduced "
- "signature, or when the command is invoked recursively inside a "
- "find-module for the package."
+ "signature. "
"\n"
"Config mode attempts to locate a configuration file provided by the "
"package to be found. A cache entry called <package>_DIR is created to "
@@ -161,10 +163,6 @@ cmFindPackageCommand::cmFindPackageCommand()
"version (format is major[.minor[.patch[.tweak]]]). "
"If the EXACT option is given only a version of the package claiming "
"an exact match of the requested version may be found. "
- "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."
- "\n"
"CMake does not establish any convention for the meaning of version "
"numbers. "
"Package version numbers are checked by \"version\" files provided by "
@@ -482,7 +480,7 @@ bool cmFindPackageCommand
cmake::AUTHOR_WARNING, "Ignoring EXACT since no version is requested.");
}
- if(!this->NoModule || this->Version.empty())
+ if(this->Version.empty())
{
// Check whether we are recursing inside "Find<name>.cmake" within
// another find_package(<name>) call.
@@ -490,22 +488,16 @@ bool cmFindPackageCommand
mod += "_FIND_MODULE";
if(this->Makefile->IsOn(mod.c_str()))
{
- // Avoid recursing back into the module.
- this->NoModule = true;
-
// Get version information from the outer call if necessary.
- if(this->Version.empty())
- {
- // 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());
- }
+ // 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());
}
}