[Cmake-commits] [cmake-commits] king committed cmMakefile.cxx 1.450 1.451 cmPolicies.cxx 1.15 1.16 cmPolicies.h 1.8 1.9 cmake.cxx 1.366 1.367

cmake-commits at cmake.org cmake-commits at cmake.org
Fri Mar 7 16:36:59 EST 2008


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

Modified Files:
	cmMakefile.cxx cmPolicies.cxx cmPolicies.h cmake.cxx 
Log Message:
ENH: Finish creating, documenting, and enforcing policy CMP_0002.


Index: cmMakefile.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefile.cxx,v
retrieving revision 1.450
retrieving revision 1.451
diff -C 2 -d -r1.450 -r1.451
*** cmMakefile.cxx	7 Mar 2008 21:01:22 -0000	1.450
--- cmMakefile.cxx	7 Mar 2008 21:36:57 -0000	1.451
***************
*** 3284,3317 ****
          }
        e << "created in source directory \""
!         << existing->GetMakefile()->GetCurrentDirectory() << "\"."
!         << "\n";
!       e <<
!         "Logical target names must be globally unique because:\n"
!         "  - Unique names may be referenced unambiguously both in CMake\n"
!         "    code and on make tool command lines.\n"
!         "  - Logical names are used by Xcode and VS IDE generators\n"
!         "    to produce meaningful project names for the targets.\n"
!         "The logical name of executable and library targets does not "
!         "have to correspond to the physical file names built.  "
!         "Consider using the OUTPUT_NAME target property to create two "
!         "targets with the same physical name while keeping logical "
!         "names distinct.  "
!         "Custom targets must simply have globally unique names."
!         "\n"
!         "If you are building an older project it is possible that "
!         "it violated this rule but was working accidentally because "
!         "CMake did not previously diagnose this problem.\n";
!       if(isCustom && existing->GetType() == cmTarget::UTILITY)
!         {
!         e <<
!           "For projects that care only about Makefile generators and do "
!           "not wish to support Xcode or VS IDE generators, one may add\n"
!           "  set_property(GLOBAL PROPERTY ALLOW_DUPLICATE_CUSTOM_TARGETS 1)\n"
!           "to the top of the project to allow duplicate custom targets "
!           "(target names must still be unique within each directory).  "
!           "However, setting this property will cause non-Makefile generators "
!           "to produce an error and refuse to generate the project.";
!         }
!         msg = e.str();
        return false;
        }
--- 3284,3290 ----
          }
        e << "created in source directory \""
!         << existing->GetMakefile()->GetCurrentDirectory() << "\".  "
!         << "See documentation for policy CMP_0002 for more details.";
!       msg = e.str();
        return false;
        }

Index: cmPolicies.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmPolicies.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -C 2 -d -r1.8 -r1.9
*** cmPolicies.h	7 Mar 2008 20:30:33 -0000	1.8
--- cmPolicies.h	7 Mar 2008 21:36:57 -0000	1.9
***************
*** 43,47 ****
      CMP_0000, // Policy version specification
      CMP_0001, // Ignore old compatibility variable
!     CMP_0002
    };
  
--- 43,51 ----
      CMP_0000, // Policy version specification
      CMP_0001, // Ignore old compatibility variable
!     CMP_0002, // Target names must be unique
! 
!     // Always the last entry.  Useful mostly to avoid adding a comma
!     // the last policy when adding a new one.
!     CMP_COUNT
    };
  

Index: cmake.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmake.cxx,v
retrieving revision 1.366
retrieving revision 1.367
diff -C 2 -d -r1.366 -r1.367
*** cmake.cxx	7 Mar 2008 20:30:33 -0000	1.366
--- cmake.cxx	7 Mar 2008 21:36:57 -0000	1.367
***************
*** 3300,3304 ****
      "Allow duplicate custom targets to be created.",
      "Normally CMake requires that all targets built in a project have "
!     "globally unique names.  "
      "This is necessary to generate meaningful project file names in "
      "Xcode and VS IDE generators.  "
--- 3300,3304 ----
      "Allow duplicate custom targets to be created.",
      "Normally CMake requires that all targets built in a project have "
!     "globally unique logical names (see policy CMP_0002).  "
      "This is necessary to generate meaningful project file names in "
      "Xcode and VS IDE generators.  "
***************
*** 3310,3314 ****
      "property to true to allow duplicate custom targets.  "
      "The property allows multiple add_custom_target command calls in "
!     "*different directories* to specify the same target name.  "
      "However, setting this property will cause non-Makefile generators "
      "to produce an error and refuse to generate the project."
--- 3310,3314 ----
      "property to true to allow duplicate custom targets.  "
      "The property allows multiple add_custom_target command calls in "
!     "different directories to specify the same target name.  "
      "However, setting this property will cause non-Makefile generators "
      "to produce an error and refuse to generate the project."

Index: cmPolicies.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmPolicies.cxx,v
retrieving revision 1.15
retrieving revision 1.16
diff -C 2 -d -r1.15 -r1.16
*** cmPolicies.cxx	7 Mar 2008 20:30:33 -0000	1.15
--- cmPolicies.cxx	7 Mar 2008 21:36:57 -0000	1.16
***************
*** 117,122 ****
    this->DefinePolicy(
      CMP_0002, "CMP_0002",
!     "CMake requires that target names be globaly unique.",
!     "....",
      2,6,0, cmPolicies::WARN
      );
--- 117,137 ----
    this->DefinePolicy(
      CMP_0002, "CMP_0002",
!     "Logical target names must be globally unique.",
!     "Targets names created with "
!     "add_executable, add_library, or add_custom_target "
!     "are logical build target names.  "
!     "Logical target names must be globally unique because:\n"
!     "  - Unique names may be referenced unambiguously both in CMake\n"
!     "    code and on make tool command lines.\n"
!     "  - Logical names are used by Xcode and VS IDE generators\n"
!     "    to produce meaningful project names for the targets.\n"
!     "The logical name of executable and library targets does not "
!     "have to correspond to the physical file names built.  "
!     "Consider using the OUTPUT_NAME target property to create two "
!     "targets with the same physical name while keeping logical "
!     "names distinct.  "
!     "Custom targets must simply have globally unique names (unless one "
!     "uses the global property ALLOW_DUPLICATE_CUSTOM_TARGETS with a "
!     "Makefiles generator).",
      2,6,0, cmPolicies::WARN
      );



More information about the Cmake-commits mailing list