[Cmake-commits] CMake branch, next, updated. v3.0.0-4151-g3c6c197

Ben Boeckel ben.boeckel at kitware.com
Tue Jul 8 10:20:04 EDT 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  3c6c1970758fbee09b4c72d85cb27097717a0c9c (commit)
       via  6208c285c8ae43d566474f488a00967b74ee4389 (commit)
       via  dc2e26df01eb4230a69c43a05b867fce330f57a4 (commit)
       via  d2803fbac6ca20c998ff5364e79f0841eba6c579 (commit)
       via  49c830d597bbd8322c7b41847eac3012064b0b7d (commit)
      from  7a9c33d47919d0554e2bfb78442c3afc67b12bb1 (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=3c6c1970758fbee09b4c72d85cb27097717a0c9c
commit 3c6c1970758fbee09b4c72d85cb27097717a0c9c
Merge: 7a9c33d 6208c28
Author:     Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Tue Jul 8 10:20:03 2014 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Jul 8 10:20:03 2014 -0400

    Merge topic 'dev/custom-target-performance' into next
    
    6208c285 cmMakefile: Defer dependency calculations
    dc2e26df cmMakefile: Avoid excess source files
    d2803fba cmMakefile: Add a CreateSource method
    49c830d5 CMake Nightly Date Stamp


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6208c285c8ae43d566474f488a00967b74ee4389
commit 6208c285c8ae43d566474f488a00967b74ee4389
Author:     Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Fri Mar 21 22:27:59 2014 -0400
Commit:     Ben Boeckel <ben.boeckel at kitware.com>
CommitDate: Tue Jul 8 10:13:51 2014 -0400

    cmMakefile: Defer dependency calculations

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 452d3f6..2218e2f 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1056,16 +1056,16 @@ cmMakefile::AddCustomCommandToOutput(const std::vector<std::string>& outputs,
       }
     }
 
-  // Construct a complete list of dependencies.
-  std::vector<std::string> depends2(depends);
-  if(!main_dependency.empty())
-    {
-    depends2.push_back(main_dependency);
-    }
-
   // Attach the custom command to the file.
   if(file)
     {
+    // Construct a complete list of dependencies.
+    std::vector<std::string> depends2(depends);
+    if(!main_dependency.empty())
+      {
+      depends2.push_back(main_dependency);
+      }
+
     cmCustomCommand* cc =
       new cmCustomCommand(this, outputs, depends2, commandLines,
                           comment, workingDir);

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dc2e26df01eb4230a69c43a05b867fce330f57a4
commit dc2e26df01eb4230a69c43a05b867fce330f57a4
Author:     Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Wed Mar 12 17:29:04 2014 -0400
Commit:     Ben Boeckel <ben.boeckel at kitware.com>
CommitDate: Tue Jul 8 10:13:51 2014 -0400

    cmMakefile: Avoid excess source files
    
    When there are no commands, a main_dependency is not required and when
    there are also no dependencies, nothing is required.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index c4543d7..452d3f6 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -989,7 +989,7 @@ cmMakefile::AddCustomCommandToOutput(const std::vector<std::string>& outputs,
 
   // Choose a source file on which to store the custom command.
   cmSourceFile* file = 0;
-  if(!main_dependency.empty())
+  if(!commandLines.empty() && !main_dependency.empty())
     {
     // The main dependency was specified.  Use it unless a different
     // custom command already used it.
@@ -1257,28 +1257,31 @@ cmMakefile::AddUtilityCommand(const std::string& utilityName,
     }
 
   // Store the custom command in the target.
-  std::string force = this->GetStartOutputDirectory();
-  force += cmake::GetCMakeFilesDirectory();
-  force += "/";
-  force += utilityName;
-  std::string no_main_dependency = "";
-  bool no_replace = false;
-  this->AddCustomCommandToOutput(force, depends,
-                                 no_main_dependency,
-                                 commandLines, comment,
-                                 workingDirectory, no_replace,
-                                 escapeOldStyle);
-  cmSourceFile* sf = target->AddSourceCMP0049(force);
-
-  // The output is not actually created so mark it symbolic.
-  if(sf)
-    {
-    sf->SetProperty("SYMBOLIC", "1");
-    }
-  else
-    {
-    cmSystemTools::Error("Could not get source file entry for ",
-                         force.c_str());
+  if (!commandLines.empty() || !depends.empty())
+    {
+    std::string force = this->GetStartOutputDirectory();
+    force += cmake::GetCMakeFilesDirectory();
+    force += "/";
+    force += utilityName;
+    std::string no_main_dependency = "";
+    bool no_replace = false;
+    this->AddCustomCommandToOutput(force, depends,
+                                   no_main_dependency,
+                                   commandLines, comment,
+                                   workingDirectory, no_replace,
+                                   escapeOldStyle);
+    cmSourceFile* sf = target->AddSourceCMP0049(force);
+
+    // The output is not actually created so mark it symbolic.
+    if(sf)
+      {
+      sf->SetProperty("SYMBOLIC", "1");
+      }
+    else
+      {
+      cmSystemTools::Error("Could not get source file entry for ",
+                          force.c_str());
+      }
     }
   return target;
 }

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d2803fbac6ca20c998ff5364e79f0841eba6c579
commit d2803fbac6ca20c998ff5364e79f0841eba6c579
Author:     Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Tue Mar 11 18:04:11 2014 -0400
Commit:     Ben Boeckel <ben.boeckel at kitware.com>
CommitDate: Tue Jul 8 10:13:50 2014 -0400

    cmMakefile: Add a CreateSource method
    
    The GetOrCreateSource searches the source file listing again, but some
    callers know that it already didn't exist.

diff --git a/Source/cmGetSourceFilePropertyCommand.cxx b/Source/cmGetSourceFilePropertyCommand.cxx
index 8a96289..7667a85 100644
--- a/Source/cmGetSourceFilePropertyCommand.cxx
+++ b/Source/cmGetSourceFilePropertyCommand.cxx
@@ -29,7 +29,7 @@ bool cmGetSourceFilePropertyCommand
   // for the location we must create a source file first
   if (!sf && args[2] == "LOCATION")
     {
-    sf = this->Makefile->GetOrCreateSource(file);
+    sf = this->Makefile->CreateSource(file);
     }
   if(sf)
     {
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 412c998..c4543d7 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1010,11 +1010,9 @@ cmMakefile::AddCustomCommandToOutput(const std::vector<std::string>& outputs,
         file = 0;
         }
       }
-    else
+    else if (!file)
       {
-      // The main dependency does not have a custom command or we are
-      // allowed to replace it.  Use it to store the command.
-      file = this->GetOrCreateSource(main_dependency);
+      file = this->CreateSource(main_dependency);
       }
     }
 
@@ -1041,8 +1039,11 @@ cmMakefile::AddCustomCommandToOutput(const std::vector<std::string>& outputs,
       }
 
     // Create a cmSourceFile for the rule file.
-    file = this->GetOrCreateSource(outName, true);
-    file->SetProperty("__CMAKE_RULE", "1");
+    if (!file)
+      {
+      file = this->CreateSource(outName, true);
+      file->SetProperty("__CMAKE_RULE", "1");
+      }
     }
 
   // Always create the output sources and mark them generated.
@@ -3451,6 +3452,19 @@ cmSourceFile* cmMakefile::GetSource(const std::string& sourceName) const
 }
 
 //----------------------------------------------------------------------------
+cmSourceFile* cmMakefile::CreateSource(const std::string& sourceName,
+                                       bool generated)
+{
+  cmSourceFile* sf = new cmSourceFile(this, sourceName);
+  if(generated)
+    {
+    sf->SetProperty("GENERATED", "1");
+    }
+  this->SourceFiles.push_back(sf);
+  return sf;
+}
+
+//----------------------------------------------------------------------------
 cmSourceFile* cmMakefile::GetOrCreateSource(const std::string& sourceName,
                                             bool generated)
 {
@@ -3460,13 +3474,7 @@ cmSourceFile* cmMakefile::GetOrCreateSource(const std::string& sourceName,
     }
   else
     {
-    cmSourceFile* sf = new cmSourceFile(this, sourceName);
-    if(generated)
-      {
-      sf->SetProperty("GENERATED", "1");
-      }
-    this->SourceFiles.push_back(sf);
-    return sf;
+    return this->CreateSource(sourceName, generated);
     }
 }
 
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index d5ffd98..3a40c1c 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -560,6 +560,13 @@ public:
    */
   cmSourceFile* GetSource(const std::string& sourceName) const;
 
+  /** Create the source file and return it. generated
+   * indicates if it is a generated file, this is used in determining
+   * how to create the source file instance e.g. name
+   */
+  cmSourceFile* CreateSource(const std::string& sourceName,
+                             bool generated = false);
+
   /** Get a cmSourceFile pointer for a given source name, if the name is
    *  not found, then create the source file and return it. generated
    * indicates if it is a generated file, this is used in determining

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

Summary of changes:
 Source/CMakeVersion.cmake                 |    2 +-
 Source/cmGetSourceFilePropertyCommand.cxx |    2 +-
 Source/cmMakefile.cxx                     |   97 ++++++++++++++++-------------
 Source/cmMakefile.h                       |    7 +++
 4 files changed, 63 insertions(+), 45 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list