[Cmake-commits] [cmake-commits] king committed cmTarget.cxx 1.230 1.231

cmake-commits at cmake.org cmake-commits at cmake.org
Mon Jan 5 09:53:16 EST 2009


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

Modified Files:
	cmTarget.cxx 
Log Message:
ENH: Enable LOCATION property for imported targets

Previously we left the LOCATION property undefined for imported targets
since it should no longer be used for non-imported targets.  However, in
the case we do not know the name of an available imported configuration,
it is more readable to get the LOCATION property than LOCATION_<CONFIG>
for a bogus configuration <CONFIG>.  This enables LOCATION for imported
targets and returns an unspecified available imported configuration.


Index: cmTarget.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmTarget.cxx,v
retrieving revision 1.230
retrieving revision 1.231
diff -C 2 -d -r1.230 -r1.231
*** cmTarget.cxx	15 Dec 2008 18:30:09 -0000	1.230
--- cmTarget.cxx	5 Jan 2009 14:53:14 -0000	1.231
***************
*** 386,398 ****
    cm->DefineProperty
      ("LOCATION", cmProperty::TARGET,
!      "Deprecated.  Use LOCATION_<CONFIG> or avoid altogether.",
!      "This property is provided for compatibility with CMake 2.4 and below. "
       "It was meant to get the location of an executable target's output file "
       "for use in add_custom_command.  "
       "In CMake 2.6 and above add_custom_command automatically recognizes a "
       "target name in its COMMAND and DEPENDS options and computes the "
!      "target location.  Therefore this property need not be used.  "
!      "This property is not defined for IMPORTED targets because they "
!      "were not available in CMake 2.4 or below anyway.");
  
    cm->DefineProperty
--- 386,404 ----
    cm->DefineProperty
      ("LOCATION", cmProperty::TARGET,
!      "Read-only location of a target on disk.",
!      "For an imported target, this read-only property returns the value of "
!      "the LOCATION_<CONFIG> property for an unspecified configuration "
!      "<CONFIG> provided by the target.\n"
!      "For a non-imported target, this property is provided for compatibility "
!      "with CMake 2.4 and below.  "
       "It was meant to get the location of an executable target's output file "
       "for use in add_custom_command.  "
+      "The path may contain a build-system-specific portion that "
+      "is replaced at build time with the configuration getting built "
+      "(such as \"$(ConfigurationName)\" in VS). "
       "In CMake 2.6 and above add_custom_command automatically recognizes a "
       "target name in its COMMAND and DEPENDS options and computes the "
!      "target location.  "
!      "Therefore this property is not needed for creating custom commands.");
  
    cm->DefineProperty
***************
*** 401,405 ****
       "A read-only property that indicates where a target's main file is "
       "located on disk for the configuration <CONFIG>.  "
!      "The property is defined only for library and executable targets.");
  
    cm->DefineProperty
--- 407,417 ----
       "A read-only property that indicates where a target's main file is "
       "located on disk for the configuration <CONFIG>.  "
!      "The property is defined only for library and executable targets.  "
!      "An imported target may provide a set of configurations different "
!      "from that of the importing project.  "
!      "By default CMake looks for an exact-match but otherwise uses an "
!      "arbitrary available configuration.  "
!      "Use the MAP_IMPORTED_CONFIG_<CONFIG> property to map imported "
!      "configurations explicitly.");
  
    cm->DefineProperty
***************
*** 2039,2049 ****
       this->GetType() == cmTarget::UNKNOWN_LIBRARY)
      {
!     if(!this->IsImported() && strcmp(prop,"LOCATION") == 0)
        {
!       // Set the LOCATION property of the target.  Note that this
        // cannot take into account the per-configuration name of the
        // target because the configuration type may not be known at
!       // CMake time.  It is now deprecated as described in the
!       // documentation.
        this->SetProperty("LOCATION", this->GetLocation(0));
        }
--- 2051,2065 ----
       this->GetType() == cmTarget::UNKNOWN_LIBRARY)
      {
!     if(strcmp(prop,"LOCATION") == 0)
        {
!       // Set the LOCATION property of the target.
!       //
!       // For an imported target this is the location of an arbitrary
!       // available configuration.
!       //
!       // For a non-imported target this is deprecated because it
        // cannot take into account the per-configuration name of the
        // target because the configuration type may not be known at
!       // CMake time.
        this->SetProperty("LOCATION", this->GetLocation(0));
        }



More information about the Cmake-commits mailing list