[Cmake-commits] [cmake-commits] king committed cmMakefile.cxx 1.451 1.452 cmPolicies.cxx 1.16 1.17

cmake-commits at cmake.org cmake-commits at cmake.org
Sat Mar 8 09:13:15 EST 2008


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

Modified Files:
	cmMakefile.cxx cmPolicies.cxx 
Log Message:
ENH: Cleanup policy generic documentation.  Cleanup some policy error/warning messages.


Index: cmPolicies.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmPolicies.cxx,v
retrieving revision 1.16
retrieving revision 1.17
diff -C 2 -d -r1.16 -r1.17
*** cmPolicies.cxx	7 Mar 2008 21:36:57 -0000	1.16
--- cmPolicies.cxx	8 Mar 2008 14:13:13 -0000	1.17
***************
*** 3,6 ****
--- 3,7 ----
  #include "cmMakefile.h"
  #include "cmSourceFile.h"
+ #include "cmVersion.h"
  #include <map>
  #include <set>
***************
*** 87,99 ****
    this->DefinePolicy(
      CMP_0000, "CMP_0000",
!     "Missing a CMake version specification. You must have a cmake_policy "
!     "call.",
!     "CMake requires that projects specify what version of CMake they have "
!     "been written to. The easiest way to do this is by placing a call to "
!     "cmake_policy at the top of your CMakeLists file. For example: "
!     "cmake_policy(VERSION 2.6) Replace "
!     "2.6 in that example with the verison of CMake you are writing to. "
!     "This policy is being put in place because it aids us in detecting "
!     "and maintaining backwards compatibility.",
      2,6,0, cmPolicies::WARN
      );
--- 88,103 ----
    this->DefinePolicy(
      CMP_0000, "CMP_0000",
!     "A policy version number must be specified.",
!     "CMake requires that projects specify the version of CMake to which "
!     "they have been written.  "
!     "This policy has been put in place to help CMake maintain backwards "
!     "compatibility with existing projects while allowing it to evolve "
!     "more rapidly.\n"
!     "The easiest way to specify a policy version number is to "
!     "call the cmake_policy command at the top of your CMakeLists file:\n"
!     "  cmake_policy(VERSION <major>.<minor>)\n"
!     "where <major>.<minor> is the version of CMake you want to support.  "
!     "The cmake_minimum_required command may also be used; see its "
!     "documentation for details.",
      2,6,0, cmPolicies::WARN
      );
***************
*** 379,383 ****
      "" << pos->second->ShortDescription << "\n"
      "Run \"cmake --help-policy " << pos->second->IDString << "\" for "
!     "policy details.\n"
      "Use the cmake_policy command to set the policy "
      "and suppress this warning.";
--- 383,387 ----
      "" << pos->second->ShortDescription << "\n"
      "Run \"cmake --help-policy " << pos->second->IDString << "\" for "
!     "policy details.  "
      "Use the cmake_policy command to set the policy "
      "and suppress this warning.";
***************
*** 403,407 ****
      "" << pos->second->ShortDescription << "\n"
      "Run \"cmake --help-policy " << pos->second->IDString << "\" for "
!     "policy details.\n"
      "CMake now requires this policy to be set to NEW by the project.  "
      "The policy may be set explicitly using the code\n"
--- 407,411 ----
      "" << pos->second->ShortDescription << "\n"
      "Run \"cmake --help-policy " << pos->second->IDString << "\" for "
!     "policy details.  "
      "CMake now requires this policy to be set to NEW by the project.  "
      "The policy may be set explicitly using the code\n"
***************
*** 437,474 ****
    for (;i != this->Policies.end(); ++i)
    {
!     std::string full;
!     full += i->second->LongDescription;
!     full += "\nThis policy was introduced in CMake version ";
!     full += i->second->GetVersionString();
!     full += ". The version of CMake you are running ";
      // add in some more text here based on status
      switch (i->second->Status)
      {
        case cmPolicies::WARN:
!         full += "defaults to warning about this policy. You can either "
!         "suppress the warning without fixing the issue by adding a "
!         "cmake_policy(SET ";
!         full += i->second->IDString;
!         full += " OLD) command to the top of your CMakeLists file or "
!         "you can change your code to use the new behavior and add "
!         "cmake_policy(SET ";
!         full += i->second->IDString;
!         full += " NEW) to your CMakeList file. If you are fixing all "
!         "issues with a new version of CMake you can add "
!         "cmake_policy(VERSION #.#) where #.# is the verison of CMake "
!         "you are updating to. This will tell CMake that you have fixed "
!         "all issues to use the new behavior.";
        case cmPolicies::OLD:
!         full += "defaults to the old behavior for this policy.";
          break;
        case cmPolicies::NEW:
!         full += "defaults to the new behavior for this policy.";
          break;
        case cmPolicies::REQUIRED_IF_USED:
!         full += "requires the new behavior for this policy."
!           "if you usee it.";
          break;
        case cmPolicies::REQUIRED_ALWAYS:
!         full += "requires the new behavior for this policy.";
          break;
      }
--- 441,470 ----
    for (;i != this->Policies.end(); ++i)
    {
!     cmOStringStream full;
!     full << i->second->LongDescription;
!     full << "\nThis policy was introduced in CMake version ";
!     full << i->second->GetVersionString() << ".  ";
!     full << "CMake version " << cmVersion::GetMajorVersion()
!          << "." << cmVersion::GetMinorVersion() << " ";
      // add in some more text here based on status
      switch (i->second->Status)
      {
        case cmPolicies::WARN:
!         full << "defaults to WARN for this policy.  "
!              << "Use the cmake_policy command to set it to OLD or NEW.";
!         break;
        case cmPolicies::OLD:
!         full << "defaults to the OLD behavior for this policy.";
          break;
        case cmPolicies::NEW:
!         full << "defaults to the NEW behavior for this policy.";
          break;
        case cmPolicies::REQUIRED_IF_USED:
!         full << "requires the policy to be set to NEW if you use it.  "
!              << "Use the cmake_policy command to set it to NEW.";
          break;
        case cmPolicies::REQUIRED_ALWAYS:
!         full << "requires the policy to be set to NEW.  "
!              << "Use the cmake_policy command to set it to NEW.";
          break;
      }
***************
*** 476,480 ****
      cmDocumentationEntry e(i->second->IDString.c_str(),
                             i->second->ShortDescription.c_str(),
!                            full.c_str());
      v.push_back(e);
    }
--- 472,476 ----
      cmDocumentationEntry e(i->second->IDString.c_str(),
                             i->second->ShortDescription.c_str(),
!                            full.str().c_str());
      v.push_back(e);
    }

Index: cmMakefile.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefile.cxx,v
retrieving revision 1.451
retrieving revision 1.452
diff -C 2 -d -r1.451 -r1.452
*** cmMakefile.cxx	7 Mar 2008 21:36:57 -0000	1.451
--- cmMakefile.cxx	8 Mar 2008 14:13:13 -0000	1.452
***************
*** 3240,3246 ****
          case cmPolicies::REQUIRED_IF_USED:
          case cmPolicies::REQUIRED_ALWAYS:
!           msg = this->GetPolicies()->
!             GetRequiredPolicyError(cmPolicies::CMP_0002);
!           return false;
          case cmPolicies::NEW:
            break;
--- 3240,3247 ----
          case cmPolicies::REQUIRED_IF_USED:
          case cmPolicies::REQUIRED_ALWAYS:
!           this->IssueError(
!             this->GetPolicies()->GetRequiredPolicyError(cmPolicies::CMP_0002)
!             );
!           return true;
          case cmPolicies::NEW:
            break;



More information about the Cmake-commits mailing list