[Cmake-commits] CMake branch, next, updated. v2.8.7-3437-g6668ef8

Alexander Neundorf neundorf at kde.org
Mon Apr 9 08:56:20 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  6668ef86590a6577be9d46f935a695ddc5ebfa06 (commit)
       via  38d4c1ed0503917954e4ad6d29898006af89c67d (commit)
      from  9d9aa82388b0b013b4f32d6d3e0ee187a95ebdf9 (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=6668ef86590a6577be9d46f935a695ddc5ebfa06
commit 6668ef86590a6577be9d46f935a695ddc5ebfa06
Merge: 9d9aa82 38d4c1e
Author:     Alexander Neundorf <neundorf at kde.org>
AuthorDate: Mon Apr 9 08:56:18 2012 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Apr 9 08:56:18 2012 -0400

    Merge topic 'OBJECTLibrariesInCodeBlocks' into next
    
    38d4c1e CodeBlocks: improve support for OBJECT libraries


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=38d4c1ed0503917954e4ad6d29898006af89c67d
commit 38d4c1ed0503917954e4ad6d29898006af89c67d
Author:     Alex Neundorf <neundorf at kde.org>
AuthorDate: Mon Apr 9 14:53:47 2012 +0200
Commit:     Alex Neundorf <neundorf at kde.org>
CommitDate: Mon Apr 9 14:53:47 2012 +0200

    CodeBlocks: improve support for OBJECT libraries
    
    This commit creates a dummy text file for each OBJECT library for
    the CodeBlocks generator, so the generated project file can reference
    a unique file for each target. Most probably these files are unused.
    
    Alex

diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx
index e0574ea..a458860 100644
--- a/Source/cmExtraCodeBlocksGenerator.cxx
+++ b/Source/cmExtraCodeBlocksGenerator.cxx
@@ -534,6 +534,31 @@ void cmExtraCodeBlocksGenerator
 }
 
 
+// Write a dummy file for OBJECT libraries, so C::B can reference some file
+std::string cmExtraCodeBlocksGenerator::CreateDummyTargetFile(
+                                        cmMakefile* mf, cmTarget* target) const
+{
+  // this file doesn't seem to be used by C::B in custom makefile mode,
+  // but we generate a unique file for each OBJECT library so in case
+  // C::B uses it in some way, the targets don't interfere with each other.
+  std::string filename = mf->GetCurrentOutputDirectory();
+  filename += "/";
+  filename += mf->GetLocalGenerator()->GetTargetDirectory(*target);
+  filename += "/";
+  filename += target->GetName();
+  filename += ".objlib";
+  cmGeneratedFileStream fout(filename.c_str());
+  if(fout)
+    {
+    fout << "# This is a dummy file for the OBJECT library "
+         << target->GetName()
+         << " for the CMake CodeBlocks project generator.\n"
+         << "# Don't edit, this file will be overwritten.\n";
+    }
+  return filename;
+}
+
+
 // Generate the xml code for one target.
 void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
                                               const char* targetName,
@@ -572,10 +597,11 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
       }
 
     const char* buildType = makefile->GetDefinition("CMAKE_BUILD_TYPE");
-    const char* location = 0;
+    std::string location;
     if ( target->GetType()==cmTarget::OBJECT_LIBRARY)
       {
-      location = "dummy"; // hmm, what to use here ?
+      location = this->CreateDummyTargetFile(const_cast<cmMakefile*>(makefile),
+                                             target);
       }
     else
       {
diff --git a/Source/cmExtraCodeBlocksGenerator.h b/Source/cmExtraCodeBlocksGenerator.h
index 57751fc..e0a64ca 100644
--- a/Source/cmExtraCodeBlocksGenerator.h
+++ b/Source/cmExtraCodeBlocksGenerator.h
@@ -44,6 +44,8 @@ private:
 
   void CreateNewProjectFile(const std::vector<cmLocalGenerator*>& lgs,
                                 const std::string& filename);
+  std::string CreateDummyTargetFile(cmMakefile* mf, cmTarget* target) const;
+
   std::string GetCBCompilerId(const cmMakefile* mf);
   int GetCBTargetType(cmTarget* target);
   std::string BuildMakeCommand(const std::string& make, const char* makefile,

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

Summary of changes:
 Source/cmExtraCodeBlocksGenerator.cxx |   30 ++++++++++++++++++++++++++++--
 Source/cmExtraCodeBlocksGenerator.h   |    2 ++
 2 files changed, 30 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list