[Cmake-commits] CMake branch, next, updated. v3.5.1-724-g079f8c0
Brad King
brad.king at kitware.com
Thu Mar 31 09:37:02 EDT 2016
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 079f8c06e92872f0e59c97733408319504e95326 (commit)
via 4828a78c1080d36935904a9620911a6f3743d792 (commit)
from 6d4e1832e9a3b7a0d32975810319f9b2a155eb08 (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 -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=079f8c06e92872f0e59c97733408319504e95326
commit 079f8c06e92872f0e59c97733408319504e95326
Merge: 6d4e183 4828a78
Author: Brad King <brad.king at kitware.com>
AuthorDate: Thu Mar 31 09:37:01 2016 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Mar 31 09:37:01 2016 -0400
Merge topic 'eclipse-source-groups' into next
4828a78c Eclipse: Implement traversal of nested source groups (#15701)
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4828a78c1080d36935904a9620911a6f3743d792
commit 4828a78c1080d36935904a9620911a6f3743d792
Author: Patrik Lehmann <Patrik.Lehmann-EXT at continental-corporation.com>
AuthorDate: Thu Mar 31 10:52:43 2016 +0200
Commit: Brad King <brad.king at kitware.com>
CommitDate: Thu Mar 31 09:34:14 2016 -0400
Eclipse: Implement traversal of nested source groups (#15701)
diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx
index f0227b0..9e67301 100644
--- a/Source/cmExtraEclipseCDT4Generator.cxx
+++ b/Source/cmExtraEclipseCDT4Generator.cxx
@@ -467,6 +467,49 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile()
xml.EndElement(); // projectDescription
}
+void cmExtraEclipseCDT4Generator::WriteGroups(
+ std::vector<cmSourceGroup> const& sourceGroups,
+ std::string& linkName, cmXMLWriter& xml)
+{
+ for(std::vector<cmSourceGroup>::const_iterator sgIt = sourceGroups.begin();
+ sgIt != sourceGroups.end(); ++sgIt)
+ {
+ std::string linkName3 = linkName;
+ linkName3 += "/";
+ linkName3 += sgIt->GetFullName();
+
+ size_t pos = 0;
+ while ((pos = linkName3.find("\\", pos)) != std::string::npos)
+ {
+ linkName3.replace(pos, 1, "/");
+ pos++;
+ }
+
+ this->AppendLinkedResource(xml, linkName3, "virtual:/virtual",
+ VirtualFolder);
+ std::vector<cmSourceGroup> const& children = sgIt->GetGroupChildren();
+ if (!children.empty())
+ {
+ this->WriteGroups(children, linkName, xml);
+ }
+ std::vector<const cmSourceFile*> sFiles = sgIt->GetSourceFiles();
+ for(std::vector<const cmSourceFile*>::const_iterator
+ fileIt = sFiles.begin(); fileIt != sFiles.end(); ++fileIt)
+ {
+ std::string fullPath = (*fileIt)->GetFullPath();
+
+ if (!cmSystemTools::FileIsDirectory(fullPath))
+ {
+ std::string linkName4 = linkName3;
+ linkName4 += "/";
+ linkName4 += cmSystemTools::GetFilenameName(fullPath);
+ this->AppendLinkedResource(xml, linkName4,
+ this->GetEclipsePath(fullPath),
+ LinkToFile);
+ }
+ }
+ }
+}
//----------------------------------------------------------------------------
void cmExtraEclipseCDT4Generator::CreateLinksForTargets(cmXMLWriter& xml)
@@ -523,34 +566,7 @@ void cmExtraEclipseCDT4Generator::CreateLinksForTargets(cmXMLWriter& xml)
sourceGroup->AssignSource(*sfIt);
}
- for(std::vector<cmSourceGroup>::iterator sgIt = sourceGroups.begin();
- sgIt != sourceGroups.end();
- ++sgIt)
- {
- std::string linkName3 = linkName2;
- linkName3 += "/";
- linkName3 += sgIt->GetFullName();
- this->AppendLinkedResource(xml, linkName3, "virtual:/virtual",
- VirtualFolder);
-
- std::vector<const cmSourceFile*> sFiles = sgIt->GetSourceFiles();
- for(std::vector<const cmSourceFile*>::const_iterator fileIt =
- sFiles.begin();
- fileIt != sFiles.end();
- ++fileIt)
- {
- std::string fullPath = (*fileIt)->GetFullPath();
- if (!cmSystemTools::FileIsDirectory(fullPath))
- {
- std::string linkName4 = linkName3;
- linkName4 += "/";
- linkName4 += cmSystemTools::GetFilenameName(fullPath);
- this->AppendLinkedResource(xml, linkName4,
- this->GetEclipsePath(fullPath),
- LinkToFile);
- }
- }
- }
+ this->WriteGroups(sourceGroups, linkName2, xml);
}
break;
// ignore all others:
diff --git a/Source/cmExtraEclipseCDT4Generator.h b/Source/cmExtraEclipseCDT4Generator.h
index 4032a6c..26955ef 100644
--- a/Source/cmExtraEclipseCDT4Generator.h
+++ b/Source/cmExtraEclipseCDT4Generator.h
@@ -18,6 +18,7 @@
class cmMakefile;
class cmXMLWriter;
+class cmSourceGroup;
/** \class cmExtraEclipseCDT4Generator
* \brief Write Eclipse project files for Makefile based projects
@@ -100,6 +101,8 @@ private:
static void AddEnvVar(std::ostream& out, const char* envVar,
cmLocalGenerator* lg);
+ void WriteGroups(std::vector<cmSourceGroup> const& sourceGroups,
+ std::string& linkName, cmXMLWriter& xml);
void CreateLinksToSubprojects(cmXMLWriter& xml, const std::string& baseDir);
void CreateLinksForTargets(cmXMLWriter& xml);
-----------------------------------------------------------------------
Summary of changes:
Source/cmExtraEclipseCDT4Generator.cxx | 72 +++++++++++++++++++-------------
Source/cmExtraEclipseCDT4Generator.h | 3 ++
2 files changed, 47 insertions(+), 28 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list