[Cmake-commits] CMake branch, next, updated. v3.0.0-rc1-668-g5255dda

Brad King brad.king at kitware.com
Sat Mar 8 08:03:14 EST 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  5255ddad3efe93491a72078ac9cadd876f48fbaa (commit)
       via  447816f03e14ca528c2277e790071cf8043ecc0a (commit)
      from  fa23334fc9cbf17803a793e8e27ff9d1e366c2a7 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5255ddad3efe93491a72078ac9cadd876f48fbaa
commit 5255ddad3efe93491a72078ac9cadd876f48fbaa
Merge: fa23334 447816f
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Sat Mar 8 08:03:13 2014 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sat Mar 8 08:03:13 2014 -0500

    Merge topic 'dev/string-apis' into next
    
    447816f0 cmTarget: Refactor GetLocation API


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=447816f03e14ca528c2277e790071cf8043ecc0a
commit 447816f03e14ca528c2277e790071cf8043ecc0a
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Sat Mar 8 07:55:46 2014 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Sat Mar 8 07:59:50 2014 -0500

    cmTarget: Refactor GetLocation API
    
    When given a non-NULL configuration the GetLocation returned the
    location for the given configuration.  When given a NULL configuration
    the GetLocation method returned a location with the build-system
    placeholder for the configuration name.  Split the latter use case out
    into a separate GetLocationForBuild method and update call sites
    accordingly.

diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 5359ed0..eb67f91 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -743,7 +743,7 @@ bool cmTargetTraceDependencies::IsUtility(std::string const& dep)
         {
         // This is really only for compatibility so we do not need to
         // worry about configuration names and output names.
-        std::string tLocation = t->GetLocation("");
+        std::string tLocation = t->GetLocationForBuild();
         tLocation = cmSystemTools::GetFilenamePath(tLocation);
         std::string depLocation = cmSystemTools::GetFilenamePath(dep);
         depLocation = cmSystemTools::CollapseFullPath(depLocation.c_str());
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 8ddb10c..5952444 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -2460,32 +2460,25 @@ std::string cmTarget::GetCompilePDBDirectory(const std::string& config) const
 //----------------------------------------------------------------------------
 const char* cmTarget::GetLocation(const std::string& config) const
 {
+  static std::string location;
   if (this->IsImported())
     {
-    return this->ImportedGetLocation(config);
+    location = this->ImportedGetFullPath(config, false);
     }
   else
     {
-    return this->NormalGetLocation(config);
+    location = this->GetFullPath(config, false);
     }
-}
-
-//----------------------------------------------------------------------------
-const char* cmTarget::ImportedGetLocation(const std::string& config) const
-{
-  static std::string location;
-  location = this->ImportedGetFullPath(config, false);
   return location.c_str();
 }
 
 //----------------------------------------------------------------------------
-const char* cmTarget::NormalGetLocation(const std::string& config) const
+const char* cmTarget::GetLocationForBuild() const
 {
   static std::string location;
-  // Handle the configuration-specific case first.
-  if(!config.empty())
+  if(this->IsImported())
     {
-    location = this->GetFullPath(config, false);
+    location = this->ImportedGetFullPath("", false);
     return location.c_str();
     }
 
@@ -2505,7 +2498,7 @@ const char* cmTarget::NormalGetLocation(const std::string& config) const
 
   if(this->IsAppBundleOnApple())
     {
-    std::string macdir = this->BuildMacContentDirectory("", config, false);
+    std::string macdir = this->BuildMacContentDirectory("", "", false);
     if(!macdir.empty())
       {
       location += "/";
@@ -2513,7 +2506,7 @@ const char* cmTarget::NormalGetLocation(const std::string& config) const
       }
     }
   location += "/";
-  location += this->GetFullName(config, false);
+  location += this->GetFullName("", false);
   return location.c_str();
 }
 
@@ -2662,7 +2655,7 @@ const char *cmTarget::GetProperty(const std::string& prop,
       // cannot take into account the per-configuration name of the
       // target because the configuration type may not be known at
       // CMake time.
-      this->Properties.SetProperty("LOCATION", this->GetLocation(""),
+      this->Properties.SetProperty("LOCATION", this->GetLocationForBuild(),
                                    cmProperty::TARGET);
       }
 
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 90d53f0..d5ef18d 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -334,10 +334,14 @@ public:
   std::string GetCompilePDBDirectory(const std::string& config = "") const;
 
   /** Get the location of the target in the build tree for the given
-      configuration.  This location is suitable for use as the LOCATION
-      target property.  */
+      configuration.  */
   const char* GetLocation(const std::string& config) const;
 
+  /** Get the location of the target in the build tree with a placeholder
+      referencing the configuration in the native build system.  This
+      location is suitable for use as the LOCATION target property.  */
+  const char* GetLocationForBuild() const;
+
   /** Get the target major and minor version numbers interpreted from
       the VERSION property.  Version 0 is returned if the property is
       not set or cannot be parsed.  */
@@ -653,9 +657,6 @@ private:
   // Get the target base name.
   std::string GetOutputName(const std::string& config, bool implib) const;
 
-  const char* ImportedGetLocation(const std::string& config) const;
-  const char* NormalGetLocation(const std::string& config) const;
-
   std::string GetFullNameImported(const std::string& config,
                                   bool implib) const;
 

-----------------------------------------------------------------------

Summary of changes:
 Source/cmGeneratorTarget.cxx |    2 +-
 Source/cmTarget.cxx          |   25 +++++++++----------------
 Source/cmTarget.h            |   11 ++++++-----
 3 files changed, 16 insertions(+), 22 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list