[Cmake-commits] CMake branch, next, updated. v2.8.7-3418-gdf54b53

Peter Kuemmel syntheticpp at gmx.net
Fri Apr 6 13:33:05 EDT 2012


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  df54b5387171fec8e8e51f54ec4c845da5be4857 (commit)
       via  8217c26813d1a1f6a81c2fe15f20ee1795d428e5 (commit)
       via  15f238fd6e989a9c163518c36a56f4d662a73f5e (commit)
      from  704356fffa22d50c986aaaa9cec6219a33ad5554 (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=df54b5387171fec8e8e51f54ec4c845da5be4857
commit df54b5387171fec8e8e51f54ec4c845da5be4857
Merge: 704356f 8217c26
Author:     Peter Kuemmel <syntheticpp at gmx.net>
AuthorDate: Fri Apr 6 13:33:03 2012 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Apr 6 13:33:03 2012 -0400

    Merge topic 'ninja-fix-plugin-test' into next
    
    8217c26 Ninja: ensure output directories exist
    15f238f KWSys Nightly Date Stamp


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8217c26813d1a1f6a81c2fe15f20ee1795d428e5
commit 8217c26813d1a1f6a81c2fe15f20ee1795d428e5
Author:     Peter Kuemmel <syntheticpp at gmx.net>
AuthorDate: Fri Apr 6 17:40:22 2012 +0200
Commit:     Peter Kuemmel <syntheticpp at gmx.net>
CommitDate: Fri Apr 6 19:31:18 2012 +0200

    Ninja: ensure output directories exist

diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index 2bad32c..2bfe814 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -47,8 +47,7 @@ cmNinjaNormalTargetGenerator(cmTarget* target)
     {
     // on Windows the output dir is already needed at compile time
     // ensure the directory exists (OutDir test)
-    std::string outpath = target->GetDirectory(this->GetConfigName());
-    cmSystemTools::MakeDirectory(outpath.c_str());
+    EnsureDirectoryExists(target->GetDirectory(this->GetConfigName()));
     }
 }
 
@@ -56,6 +55,18 @@ cmNinjaNormalTargetGenerator::~cmNinjaNormalTargetGenerator()
 {
 }
 
+void cmNinjaNormalTargetGenerator::EnsureDirectoryExists(const std::string& dir)
+{
+  cmSystemTools::MakeDirectory(dir.c_str());
+}
+
+void cmNinjaNormalTargetGenerator::EnsureParentDirectoryExists(const std::string& path)
+{
+  EnsureDirectoryExists(cmSystemTools::GetParentDirectory(path.c_str()));
+}
+
+
+
 void cmNinjaNormalTargetGenerator::Generate()
 {
   if (!this->TargetLinkLanguage) {
@@ -380,13 +391,18 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
     }
   }
 
+  std::string path;
   if (!this->TargetNameImport.empty()) {
-    vars["TARGET_IMPLIB"] = this->GetLocalGenerator()->ConvertToOutputFormat(
-      targetOutputImplib.c_str(), cmLocalGenerator::SHELL);
+    path = this->GetLocalGenerator()->ConvertToOutputFormat(
+                    targetOutputImplib.c_str(), cmLocalGenerator::SHELL);
+    vars["TARGET_IMPLIB"] = path;
+    EnsureParentDirectoryExists(path);
   }
 
-  vars["TARGET_PDB"] = this->GetLocalGenerator()->ConvertToOutputFormat(
-    this->GetTargetPDB().c_str(), cmLocalGenerator::SHELL);
+  path = this->GetLocalGenerator()->ConvertToOutputFormat(
+                   this->GetTargetPDB().c_str(), cmLocalGenerator::SHELL);
+  vars["TARGET_PDB"] = path;
+  EnsureParentDirectoryExists(path);
 
   std::vector<cmCustomCommand> *cmdLists[3] = {
     &this->GetTarget()->GetPreBuildCommands(),
diff --git a/Source/cmNinjaNormalTargetGenerator.h b/Source/cmNinjaNormalTargetGenerator.h
index 1702caf..7acbe8f 100644
--- a/Source/cmNinjaNormalTargetGenerator.h
+++ b/Source/cmNinjaNormalTargetGenerator.h
@@ -35,6 +35,9 @@ private:
   void WriteObjectLibStatement();
   std::vector<std::string> ComputeLinkCmd();
 
+  void EnsureDirectoryExists(const std::string& dir);
+  void EnsureParentDirectoryExists(const std::string& path);
+
 private:
   // Target name info.
   std::string TargetNameOut;

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

Summary of changes:
 Source/cmNinjaNormalTargetGenerator.cxx |   28 ++++++++++++++++++++++------
 Source/cmNinjaNormalTargetGenerator.h   |    3 +++
 Source/kwsys/kwsysDateStamp.cmake       |    2 +-
 3 files changed, 26 insertions(+), 7 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list