[Cmake-commits] [cmake-commits] king committed cmFindPackageCommand.cxx 1.48 1.49

cmake-commits at cmake.org cmake-commits at cmake.org
Wed Oct 8 10:56:25 EDT 2008


Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv28853/Source

Modified Files:
	cmFindPackageCommand.cxx 
Log Message:
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.


Index: cmFindPackageCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmFindPackageCommand.cxx,v
retrieving revision 1.48
retrieving revision 1.49
diff -C 2 -d -r1.48 -r1.49
*** cmFindPackageCommand.cxx	3 Oct 2008 14:41:15 -0000	1.48
--- cmFindPackageCommand.cxx	8 Oct 2008 14:56:23 -0000	1.49
***************
*** 92,95 ****
--- 92,98 ----
      "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"
***************
*** 130,135 ****
      "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."
      "\n"
      "Config mode attempts to locate a configuration file provided by the "
--- 133,137 ----
      "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.  "
      "\n"
      "Config mode attempts to locate a configuration file provided by the "
***************
*** 162,169 ****
      "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.  "
--- 164,167 ----
***************
*** 483,487 ****
      }
  
!   if(!this->NoModule || this->Version.empty())
      {
      // Check whether we are recursing inside "Find<name>.cmake" within
--- 481,485 ----
      }
  
!   if(this->Version.empty())
      {
      // Check whether we are recursing inside "Find<name>.cmake" within
***************
*** 491,510 ****
      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());
!         }
        }
      }
--- 489,502 ----
      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());
        }
      }



More information about the Cmake-commits mailing list