[Cmake-commits] CMake branch, next, updated. v3.3.0-rc4-1125-ge0167a1

Stephen Kelly steveire at gmail.com
Sat Jul 18 07:59:12 EDT 2015


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  e0167a141f74b7f39471150010c328202b4859b7 (commit)
       via  881613c4abbbca35223678d6b17da418958a0005 (commit)
       via  357342602db67e456e9afc9697328d490ab0fc41 (commit)
       via  e7fbd489e0da88e2fd70aa039da4f4173ee24028 (commit)
      from  2376c7ef8149c7bad49a73d8d62ba09fbdd84883 (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=e0167a141f74b7f39471150010c328202b4859b7
commit e0167a141f74b7f39471150010c328202b4859b7
Merge: 2376c7e 881613c
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Jul 18 07:59:11 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sat Jul 18 07:59:11 2015 -0400

    Merge topic 'remove-special-LINK_DIRECTORIES-handling' into next
    
    881613c4 cmMakefile: Remove special handling of LINK_DIRECTORIES property.
    35734260 cmMakefile: Inline only use of GetLinkDirectories.
    e7fbd489 CMake Nightly Date Stamp


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=881613c4abbbca35223678d6b17da418958a0005
commit 881613c4abbbca35223678d6b17da418958a0005
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Jul 18 13:52:46 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Jul 18 13:56:48 2015 +0200

    cmMakefile: Remove special handling of LINK_DIRECTORIES property.
    
    There is no need to handle it in a special way.

diff --git a/Source/cmLinkDirectoriesCommand.cxx b/Source/cmLinkDirectoriesCommand.cxx
index f486bf7..b6c0072 100644
--- a/Source/cmLinkDirectoriesCommand.cxx
+++ b/Source/cmLinkDirectoriesCommand.cxx
@@ -65,5 +65,5 @@ void cmLinkDirectoriesCommand::AddLinkDir(std::string const& dir)
       unixPath = tmp;
       }
     }
-  this->Makefile->AddLinkDirectory(unixPath);
+  this->Makefile->AppendProperty("LINK_DIRECTORIES", unixPath.c_str());
 }
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 1dc0bb7..3c8a41d2 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1520,31 +1520,6 @@ void cmMakefile::AddLinkLibrary(const std::string& lib)
   this->AddLinkLibrary(lib,cmTarget::GENERAL);
 }
 
-void cmMakefile::AddLinkDirectory(const std::string& dir)
-{
-  // Don't add a link directory that is already present.  Yes, this
-  // linear search results in n^2 behavior, but n won't be getting
-  // much bigger than 20.  We cannot use a set because of order
-  // dependency of the link search path.
-
-  if(dir.empty())
-    {
-    return;
-    }
-  std::string newdir = dir;
-  // remove trailing slashes
-  if(*dir.rbegin() == '/')
-    {
-    newdir = dir.substr(0, dir.size()-1);
-    }
-  if(std::find(this->LinkDirectories.begin(),
-               this->LinkDirectories.end(), newdir)
-      == this->LinkDirectories.end())
-    {
-    this->LinkDirectories.push_back(dir);
-    }
-}
-
 void cmMakefile::InitializeFromParent(cmMakefile* parent)
 {
   // Initialize definitions with the closure of the parent scope.
@@ -1607,7 +1582,8 @@ void cmMakefile::InitializeFromParent(cmMakefile* parent)
   this->LinkLibraries = parent->LinkLibraries;
 
   // link directories
-  this->LinkDirectories = parent->LinkDirectories;
+  this->SetProperty("LINK_DIRECTORIES",
+                    parent->GetProperty("LINK_DIRECTORIES"));
 
   // the initial project name
   this->ProjectName = parent->ProjectName;
@@ -2145,11 +2121,26 @@ void cmMakefile::AddGlobalLinkInformation(const std::string& name,
       return;
     default:;
     }
-  std::vector<std::string>::iterator j;
-  for(j = this->LinkDirectories.begin();
-      j != this->LinkDirectories.end(); ++j)
+  if (const char* linkDirsProp = this->GetProperty("LINK_DIRECTORIES"))
     {
-    target.AddLinkDirectory(*j);
+    std::vector<std::string> linkDirs;
+    cmSystemTools::ExpandListArgument(linkDirsProp, linkDirs);
+
+    for(std::vector<std::string>::iterator j = linkDirs.begin();
+        j != linkDirs.end(); ++j)
+      {
+      std::string newdir = *j;
+      // remove trailing slashes
+      if(*j->rbegin() == '/')
+        {
+        newdir = j->substr(0, j->size()-1);
+        }
+      if(std::find(this->LinkDirectories.begin(),
+                   this->LinkDirectories.end(), newdir)
+          == this->LinkDirectories.end())
+        {target.AddLinkDirectory(*j);
+        }
+      }
     }
   target.MergeLinkLibraries( *this, name, this->LinkLibraries );
 }
@@ -2424,19 +2415,19 @@ void cmMakefile::ExpandVariablesCMP0019()
       }
     }
 
-  for(std::vector<std::string>::iterator d = this->LinkDirectories.begin();
-      d != this->LinkDirectories.end(); ++d)
+  if (const char* linkDirsProp = this->GetProperty("LINK_DIRECTORIES"))
     {
-    if(mightExpandVariablesCMP0019(d->c_str()))
+    if(mightExpandVariablesCMP0019(linkDirsProp))
       {
-      std::string orig = *d;
-      this->ExpandVariablesInString(*d, true, true);
-      if(pol == cmPolicies::WARN && *d != orig)
+      std::string d = linkDirsProp;
+      std::string orig = linkDirsProp;
+      this->ExpandVariablesInString(d, true, true);
+      if(pol == cmPolicies::WARN && d != orig)
         {
-        w << "Evaluated link directory\n"
+        w << "Evaluated link directories\n"
           << "  " << orig << "\n"
           << "as\n"
-          << "  " << *d << "\n";
+          << "  " << d << "\n";
         }
       }
     }
@@ -4147,16 +4138,6 @@ int cmMakefile::ConfigureFile(const char* infile, const char* outfile,
 
 void cmMakefile::SetProperty(const std::string& prop, const char* value)
 {
-  if ( prop == "LINK_DIRECTORIES" )
-    {
-    std::vector<std::string> varArgsExpanded;
-    if(value)
-      {
-      cmSystemTools::ExpandListArgument(value, varArgsExpanded);
-      }
-    this->SetLinkDirectories(varArgsExpanded);
-    return;
-    }
   if (prop == "INCLUDE_DIRECTORIES")
     {
     this->IncludeDirectoriesEntries.clear();
@@ -4237,17 +4218,6 @@ void cmMakefile::AppendProperty(const std::string& prop,
                                         cmValueWithOrigin(value, lfbt));
     return;
     }
-  if ( prop == "LINK_DIRECTORIES" )
-    {
-    std::vector<std::string> varArgsExpanded;
-    cmSystemTools::ExpandListArgument(value, varArgsExpanded);
-    for(std::vector<std::string>::const_iterator vi = varArgsExpanded.begin();
-        vi != varArgsExpanded.end(); ++vi)
-      {
-      this->AddLinkDirectory(*vi);
-      }
-    return;
-    }
 
   this->Properties.AppendProperty(prop, value, asString);
 }
@@ -4300,11 +4270,6 @@ const char *cmMakefile::GetProperty(const std::string& prop,
     this->GetListOfMacros(output);
     return output.c_str();
     }
-  else if (prop == "LINK_DIRECTORIES")
-    {
-    output = cmJoin(this->LinkDirectories, ";");
-    return output.c_str();
-    }
   else if (prop == "INCLUDE_DIRECTORIES")
     {
     std::string sep;
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 154e099..98d199a 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -229,16 +229,6 @@ public:
   void AddLinkDirectoryForTarget(const std::string& tgt, const std::string& d);
 
   /**
-   * Add a link directory to the build.
-   */
-  void AddLinkDirectory(const std::string&);
-
-  void SetLinkDirectories(const std::vector<std::string>& vec)
-    {
-      this->LinkDirectories = vec;
-    }
-
-  /**
    * Add a subdirectory to the build.
    */
   void AddSubDirectory(const std::string& fullSrcDir,
diff --git a/Tests/RunCMake/CMP0019/CMP0019-WARN-stderr.txt b/Tests/RunCMake/CMP0019/CMP0019-WARN-stderr.txt
index 03faef9..1e4b47d 100644
--- a/Tests/RunCMake/CMP0019/CMP0019-WARN-stderr.txt
+++ b/Tests/RunCMake/CMP0019/CMP0019-WARN-stderr.txt
@@ -21,13 +21,13 @@ CMake Warning \(dev\) in CMakeLists.txt:
 
     /usr/include/VAL_INCLUDE;/usr/include/normal
 
-  Evaluated link directory
+  Evaluated link directories
 
-    /usr/lib/\${VAR_LINK_DIRS}
+    /usr/lib/\${VAR_LINK_DIRS};/usr/lib/normal
 
   as
 
-    /usr/lib/VAL_LINK_DIRS
+    /usr/lib/VAL_LINK_DIRS;/usr/lib/normal
 
   Evaluated link library
 

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=357342602db67e456e9afc9697328d490ab0fc41
commit 357342602db67e456e9afc9697328d490ab0fc41
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Jul 18 13:45:43 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Jul 18 13:45:43 2015 +0200

    cmMakefile: Inline only use of GetLinkDirectories.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 94c77e1..1dc0bb7 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -4302,7 +4302,7 @@ const char *cmMakefile::GetProperty(const std::string& prop,
     }
   else if (prop == "LINK_DIRECTORIES")
     {
-    output = cmJoin(this->GetLinkDirectories(), ";");
+    output = cmJoin(this->LinkDirectories, ";");
     return output.c_str();
     }
   else if (prop == "INCLUDE_DIRECTORIES")
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 82a2279..154e099 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -233,10 +233,6 @@ public:
    */
   void AddLinkDirectory(const std::string&);
 
-  const std::vector<std::string>& GetLinkDirectories() const
-    {
-      return this->LinkDirectories;
-    }
   void SetLinkDirectories(const std::vector<std::string>& vec)
     {
       this->LinkDirectories = vec;

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

Summary of changes:
 Source/CMakeVersion.cmake                      |    2 +-
 Source/cmLinkDirectoriesCommand.cxx            |    2 +-
 Source/cmMakefile.cxx                          |   93 ++++++++----------------
 Source/cmMakefile.h                            |   14 ----
 Tests/RunCMake/CMP0019/CMP0019-WARN-stderr.txt |    6 +-
 5 files changed, 34 insertions(+), 83 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list