[Cmake-commits] CMake branch, next, updated. v2.8.9-1143-gd610823

Alexander Neundorf neundorf at kde.org
Wed Oct 17 17:46:33 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  d6108237624254adb4e20c7c45b98f310e6bc626 (commit)
       via  fbda95883c3a86e5b808c78fa433bd9dbcc93754 (commit)
      from  7932fa13cb4be6e0b5ed30ec1952d9646220e404 (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=d6108237624254adb4e20c7c45b98f310e6bc626
commit d6108237624254adb4e20c7c45b98f310e6bc626
Merge: 7932fa1 fbda958
Author:     Alexander Neundorf <neundorf at kde.org>
AuthorDate: Wed Oct 17 17:46:31 2012 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Oct 17 17:46:31 2012 -0400

    Merge topic 'EclipseNoLinkedResources' into next
    
    fbda958 Eclipse: add switch to disable linked resources (#13189)


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fbda95883c3a86e5b808c78fa433bd9dbcc93754
commit fbda95883c3a86e5b808c78fa433bd9dbcc93754
Author:     Alex Neundorf <neundorf at kde.org>
AuthorDate: Wed Oct 17 23:45:02 2012 +0200
Commit:     Alex Neundorf <neundorf at kde.org>
CommitDate: Wed Oct 17 23:45:02 2012 +0200

    Eclipse: add switch to disable linked resources (#13189)
    
    Eclipse may get confused by these linked resources, because it sees
    the same source file multiple times then and doesn't recognize
    that it's the same file actually.
    
    Alex

diff --git a/Modules/CMakeFindEclipseCDT4.cmake b/Modules/CMakeFindEclipseCDT4.cmake
index 37b72fa..ae17454 100644
--- a/Modules/CMakeFindEclipseCDT4.cmake
+++ b/Modules/CMakeFindEclipseCDT4.cmake
@@ -77,6 +77,8 @@ endif()
 # This variable is used by the Eclipse generator and appended to the make invocation commands.
 set(CMAKE_ECLIPSE_MAKE_ARGUMENTS "${_CMAKE_ECLIPSE_INITIAL_MAKE_ARGS}" CACHE STRING "Additional command line arguments when Eclipse invokes make. Enter e.g. -j<some_number> to get parallel builds")
 
+set(CMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES TRUE CACHE BOOL "If disabled, CMake will not generate linked resource to the subprojects and to the source files within targets")
+
 # This variable is used by the Eclipse generator in out-of-source builds only.
 set(CMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT FALSE CACHE BOOL "If enabled, CMake will generate a source project for Eclipse in CMAKE_SOURCE_DIR")
 mark_as_advanced(CMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT)
diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx
index 689f213..ca7379e 100644
--- a/Source/cmExtraEclipseCDT4Generator.cxx
+++ b/Source/cmExtraEclipseCDT4Generator.cxx
@@ -38,6 +38,7 @@ cmExtraEclipseCDT4Generator
   this->SupportedGlobalGenerators.push_back("Unix Makefiles");
 
   this->SupportsVirtualFolders = true;
+  this->GenerateLinkedResources = true;
 }
 
 //----------------------------------------------------------------------------
@@ -83,6 +84,9 @@ void cmExtraEclipseCDT4Generator::Generate()
   this->HomeDirectory       = mf->GetHomeDirectory();
   this->HomeOutputDirectory = mf->GetHomeOutputDirectory();
 
+  this->GenerateLinkedResources = mf->IsOn(
+                                    "CMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES");
+
   this->IsOutOfSourceBuild = (this->HomeDirectory!=this->HomeOutputDirectory);
 
   this->GenerateSourceProject = (this->IsOutOfSourceBuild &&
@@ -501,6 +505,10 @@ void cmExtraEclipseCDT4Generator::CreateLinksForTargets(
           linkName2 += ti->first;
           this->AppendLinkedResource(fout, linkName2, "virtual:/virtual",
                                      VirtualFolder);
+          if (!this->GenerateLinkedResources)
+            {
+            break; // skip generating the linked resources to the source files
+            }
           std::vector<cmSourceGroup> sourceGroups=makefile->GetSourceGroups();
           // get the files from the source lists then add them to the groups
           cmTarget* tgt = const_cast<cmTarget*>(&ti->second);
@@ -555,6 +563,11 @@ void cmExtraEclipseCDT4Generator::CreateLinksForTargets(
 void cmExtraEclipseCDT4Generator::CreateLinksToSubprojects(
                        cmGeneratedFileStream& fout, const std::string& baseDir)
 {
+  if (!this->GenerateLinkedResources)
+    {
+    return;
+    }
+
   // for each sub project create a linked resource to the source dir
   // - only if it is an out-of-source build
   this->AppendLinkedResource(fout, "[Subprojects]",
diff --git a/Source/cmExtraEclipseCDT4Generator.h b/Source/cmExtraEclipseCDT4Generator.h
index 37ce65e..31ad68d 100644
--- a/Source/cmExtraEclipseCDT4Generator.h
+++ b/Source/cmExtraEclipseCDT4Generator.h
@@ -109,6 +109,7 @@ private:
   std::string HomeOutputDirectory;
   bool IsOutOfSourceBuild;
   bool GenerateSourceProject;
+  bool GenerateLinkedResources;
   bool SupportsVirtualFolders;
 
 };

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

Summary of changes:
 Modules/CMakeFindEclipseCDT4.cmake     |    2 ++
 Source/cmExtraEclipseCDT4Generator.cxx |   13 +++++++++++++
 Source/cmExtraEclipseCDT4Generator.h   |    1 +
 3 files changed, 16 insertions(+), 0 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list