[Cmake-commits] CMake branch, next, updated. v2.8.12-4632-g3f266dc

Stephen Kelly steveire at gmail.com
Tue Oct 29 10:44:49 EDT 2013


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  3f266dc03cd4169d84c24b9cfef7d049e4712f8d (commit)
       via  638843af984281c67edcc9ea9e05712ac9075d04 (commit)
      from  d311799195cfe42790c73d521a9d05997fa67dcb (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=3f266dc03cd4169d84c24b9cfef7d049e4712f8d
commit 3f266dc03cd4169d84c24b9cfef7d049e4712f8d
Merge: d311799 638843a
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Oct 29 10:44:47 2013 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Oct 29 10:44:47 2013 -0400

    Merge topic 'use-generator-target' into next
    
    638843a Remove the Location member from cmTarget.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=638843af984281c67edcc9ea9e05712ac9075d04
commit 638843af984281c67edcc9ea9e05712ac9075d04
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Oct 7 11:01:13 2012 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Oct 29 15:42:42 2013 +0100

    Remove the Location member from cmTarget.
    
    It is never used. Presumably it only exists so that a const char * can
    be returned from GetLocation. However, that is getting in the way
    now, so use a static std::string instead, which is already a common
    pattern in cmake.

diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 13554dd..0c9e8f0 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -2721,27 +2721,34 @@ const char* cmTarget::GetLocation(const char* config)
 //----------------------------------------------------------------------------
 const char* cmTarget::ImportedGetLocation(const char* config)
 {
-  this->Location = this->ImportedGetFullPath(config, false);
-  return this->Location.c_str();
+  static std::string location;
+  location = this->ImportedGetFullPath(config, false);
+  return location.c_str();
 }
 
 //----------------------------------------------------------------------------
 const char* cmTarget::NormalGetLocation(const char* config)
 {
+  static std::string location;
   // Handle the configuration-specific case first.
   if(config)
     {
-    this->Location = this->GetFullPath(config, false);
-    return this->Location.c_str();
+    location = this->GetFullPath(config, false);
+    return location.c_str();
     }
 
   // Now handle the deprecated build-time configuration location.
-  this->Location = this->GetDirectory();
+  location = this->GetDirectory();
+  if(!location.empty())
+    {
+    location += "/";
+    }
   const char* cfgid = this->Makefile->GetDefinition("CMAKE_CFG_INTDIR");
   if(cfgid && strcmp(cfgid, ".") != 0)
     {
-    this->Location += "/";
-    this->Location += cfgid;
+    location += "/";
+    location += cfgid;
+    location += "/";
     }
 
   if(this->IsAppBundleOnApple())
@@ -2749,13 +2756,13 @@ const char* cmTarget::NormalGetLocation(const char* config)
     std::string macdir = this->BuildMacContentDirectory("", config, false);
     if(!macdir.empty())
       {
-      this->Location += "/";
-      this->Location += macdir;
+      location += "/";
+      location += macdir;
       }
     }
-  this->Location += "/";
-  this->Location += this->GetFullName(config, false);
-  return this->Location.c_str();
+  location += "/";
+  location += this->GetFullName(config, false);
+  return location.c_str();
 }
 
 //----------------------------------------------------------------------------
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index dd05d5b..41af8ab 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -674,7 +674,6 @@ private:
   bool HaveInstallRule;
   std::string InstallPath;
   std::string RuntimeInstallPath;
-  std::string Location;
   std::string ExportMacro;
   std::set<cmStdString> Utilities;
   bool RecordDependencies;

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

Summary of changes:
 Source/cmTarget.cxx |   31 +++++++++++++++++++------------
 Source/cmTarget.h   |    1 -
 2 files changed, 19 insertions(+), 13 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list