[Cmake-commits] CMake branch, next, updated. v2.8.6-2145-ge23013e

Brad King brad.king at kitware.com
Tue Dec 6 14:20:14 EST 2011


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  e23013e4a96908d92a33041da93bf629d1dee0dc (commit)
       via  96f65ba68e82b64eac67b75282bbcab8103c0eb0 (commit)
      from  9cbb99c110721b492d852c6a2510ce28a069e862 (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=e23013e4a96908d92a33041da93bf629d1dee0dc
commit e23013e4a96908d92a33041da93bf629d1dee0dc
Merge: 9cbb99c 96f65ba
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Dec 6 14:20:09 2011 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Dec 6 14:20:09 2011 -0500

    Merge topic 'refactor-versioned-lib-names' into next
    
    96f65ba cmTarget: Create helper method for versioned library names


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=96f65ba68e82b64eac67b75282bbcab8103c0eb0
commit 96f65ba68e82b64eac67b75282bbcab8103c0eb0
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Dec 1 16:21:25 2011 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Dec 6 14:19:44 2011 -0500

    cmTarget: Create helper method for versioned library names
    
    Replace the duplicate logic for the realName and soName of versioned
    shared libraries with calls to a new ComputeVersionedName method.

diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index d021990..014c38f 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -131,6 +131,7 @@ cmTarget::cmTarget()
   this->LinkLibrariesAnalyzed = false;
   this->HaveInstallRule = false;
   this->DLLPlatform = false;
+  this->IsApple = false;
   this->IsImportedTarget = false;
 }
 
@@ -1207,6 +1208,9 @@ void cmTarget::SetMakefile(cmMakefile* mf)
                        this->Makefile->IsOn("CYGWIN") ||
                        this->Makefile->IsOn("MINGW"));
 
+  // Check whether we are targeting an Apple platform.
+  this->IsApple = this->Makefile->IsOn("APPLE");
+
   // Setup default property values.
   this->SetPropertyDefault("INSTALL_NAME_DIR", "");
   this->SetPropertyDefault("INSTALL_RPATH", "");
@@ -3348,7 +3352,11 @@ void cmTarget::GetLibraryNames(std::string& name,
     // the library version as the soversion.
     soversion = version;
     }
-  bool isApple = this->Makefile->IsOn("APPLE");
+  if(!version && soversion)
+    {
+    // Use the soversion as the library version.
+    version = soversion;
+    }
 
   // Get the components of the library name.
   std::string prefix;
@@ -3360,47 +3368,12 @@ void cmTarget::GetLibraryNames(std::string& name,
   name = prefix+base+suffix;
 
   // The library's soname.
-  if(isApple)
-    {
-    soName = prefix+base;
-    }
-  else
-    {
-    soName = name;
-    }
-  if(soversion)
-    {
-    soName += ".";
-    soName += soversion;
-    }
-  if(isApple)
-    {
-    soName += suffix;
-    }
+  this->ComputeVersionedName(soName, prefix, base, suffix,
+                             name, soversion);
 
   // The library's real name on disk.
-  if(isApple)
-    {
-    realName = prefix+base;
-    }
-  else
-    {
-  realName = name;
-    }
-  if(version)
-    {
-    realName += ".";
-    realName += version;
-    }
-  else if(soversion)
-    {
-    realName += ".";
-    realName += soversion;
-    }
-  if(isApple)
-    {
-    realName += suffix;
-    }
+  this->ComputeVersionedName(realName, prefix, base, suffix,
+                             name, version);
 
   // The import library name.
   if(this->GetType() == cmTarget::SHARED_LIBRARY ||
@@ -3418,6 +3391,23 @@ void cmTarget::GetLibraryNames(std::string& name,
 }
 
 //----------------------------------------------------------------------------
+void cmTarget::ComputeVersionedName(std::string& vName,
+                                    std::string const& prefix,
+                                    std::string const& base,
+                                    std::string const& suffix,
+                                    std::string const& name,
+                                    const char* version)
+{
+  vName = this->IsApple? (prefix+base) : name;
+  if(version)
+    {
+    vName += ".";
+    vName += version;
+    }
+  vName += this->IsApple? suffix : std::string();
+}
+
+//----------------------------------------------------------------------------
 void cmTarget::GetExecutableNames(std::string& name,
                                   std::string& realName,
                                   std::string& impName,
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 0abdddb..9ef64f5 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -557,6 +557,7 @@ private:
   cmPropertyMap Properties;
   LinkLibraryVectorType OriginalLinkLibraries;
   bool DLLPlatform;
+  bool IsApple;
   bool IsImportedTarget;
 
   // Cache target output paths for each configuration.
@@ -595,6 +596,12 @@ private:
   cmTargetInternalPointer Internal;
 
   void ConstructSourceFileFlags();
+  void ComputeVersionedName(std::string& vName,
+                            std::string const& prefix,
+                            std::string const& base,
+                            std::string const& suffix,
+                            std::string const& name,
+                            const char* version);
 };
 
 typedef std::map<cmStdString,cmTarget> cmTargets;

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

Summary of changes:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list