[Cmake-commits] CMake branch, next, updated. v2.8.12.1-5369-gd6bb45d

Ben Boeckel ben.boeckel at kitware.com
Tue Nov 19 12:11:19 EST 2013


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  d6bb45d1a9b005da1bdf997091de199b8cc90219 (commit)
       via  a990722b5a8fc15058e7024ec54885ec24ed4bbf (commit)
       via  51726cce64ee8bce1115f3c6d092b4ae6f43d714 (commit)
       via  4a352d43bbe3c8726046683e7dbc89a55b5e1c67 (commit)
      from  8edd796a825a5e069209e970064bbeed1a675225 (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=d6bb45d1a9b005da1bdf997091de199b8cc90219
commit d6bb45d1a9b005da1bdf997091de199b8cc90219
Merge: 8edd796 a990722
Author:     Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Tue Nov 19 12:11:13 2013 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Nov 19 12:11:13 2013 -0500

    Merge topic 'dev/better-eclipse-language-support' into next
    
    a990722 eclipse: Support custom natures via a global property
    51726cc eclipse: Add natures for Eclipse based on enabled languages
    4a352d4 Notify extra generators about languages


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a990722b5a8fc15058e7024ec54885ec24ed4bbf
commit a990722b5a8fc15058e7024ec54885ec24ed4bbf
Author:     Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Thu Aug 29 14:51:59 2013 -0400
Commit:     Ben Boeckel <ben.boeckel at kitware.com>
CommitDate: Tue Nov 19 11:48:19 2013 -0500

    eclipse: Support custom natures via a global property
    
    This is useful for enabling natures not recognized by the Eclipse
    generator directly in a project.

diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst
index d6d42ad..abc6fde 100644
--- a/Help/manual/cmake-properties.7.rst
+++ b/Help/manual/cmake-properties.7.rst
@@ -28,6 +28,7 @@ Properties of Global Scope
    /prop_gbl/PACKAGES_FOUND
    /prop_gbl/PACKAGES_NOT_FOUND
    /prop_gbl/PREDEFINED_TARGETS_FOLDER
+   /prop_gbl/ECLIPSE_EXTRA_NATURES
    /prop_gbl/REPORT_UNDEFINED_PROPERTIES
    /prop_gbl/RULE_LAUNCH_COMPILE
    /prop_gbl/RULE_LAUNCH_CUSTOM
diff --git a/Help/prop_gbl/ECLIPSE_EXTRA_NATURES.rst b/Help/prop_gbl/ECLIPSE_EXTRA_NATURES.rst
new file mode 100644
index 0000000..6d1529d
--- /dev/null
+++ b/Help/prop_gbl/ECLIPSE_EXTRA_NATURES.rst
@@ -0,0 +1,8 @@
+ECLIPSE_EXTRA_NATURES
+---------------------
+
+List of natures to add to the generated Eclipse project file.
+
+Eclipse projects specify language plugins by using natures. This property
+should be set to the unique identifier for a nature (which looks like a Java
+package name).
diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx
index effc38c..755b445 100644
--- a/Source/cmExtraEclipseCDT4Generator.cxx
+++ b/Source/cmExtraEclipseCDT4Generator.cxx
@@ -465,6 +465,18 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile()
     fout << "\t\t<nature>" << *nit << "</nature>\n";
     }
 
+  if (const char *extraNaturesProp = mf->GetCMakeInstance()->
+        GetProperty("ECLIPSE_EXTRA_NATURES", cmProperty::GLOBAL))
+    {
+    std::vector<std::string> extraNatures;
+    cmSystemTools::ExpandListArgument(extraNaturesProp, extraNatures);
+    for (std::vector<std::string>::const_iterator nit = extraNatures.begin();
+         nit != extraNatures.end(); ++nit)
+      {
+      fout << "\t\t<nature>" << *nit << "</nature>\n";
+      }
+    }
+
   fout << "\t</natures>\n";
 
   fout << "\t<linkedResources>\n";

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=51726cce64ee8bce1115f3c6d092b4ae6f43d714
commit 51726cce64ee8bce1115f3c6d092b4ae6f43d714
Author:     Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Thu Aug 29 14:46:17 2013 -0400
Commit:     Ben Boeckel <ben.boeckel at kitware.com>
CommitDate: Tue Nov 19 11:48:19 2013 -0500

    eclipse: Add natures for Eclipse based on enabled languages
    
    Also adds support for the Java nature if Java is being used.

diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx
index 676d4ed..effc38c 100644
--- a/Source/cmExtraEclipseCDT4Generator.cxx
+++ b/Source/cmExtraEclipseCDT4Generator.cxx
@@ -51,6 +51,29 @@ void cmExtraEclipseCDT4Generator
 }
 
 //----------------------------------------------------------------------------
+void cmExtraEclipseCDT4Generator
+::EnableLanguage(std::vector<std::string> const& languages,
+                 cmMakefile *, bool)
+{
+  for (std::vector<std::string>::const_iterator lit = languages.begin();
+       lit != languages.end(); ++lit)
+    {
+    if (*lit == "CXX")
+      {
+      this->Natures.insert("org.eclipse.cdt.core.ccnature");
+      }
+    else if (*lit == "C")
+      {
+      this->Natures.insert("org.eclipse.cdt.core.cnature");
+      }
+    else if (*lit == "Java")
+      {
+      this->Natures.insert("org.eclipse.jdt.core.javanature");
+      }
+    }
+}
+
+//----------------------------------------------------------------------------
 void cmExtraEclipseCDT4Generator::Generate()
 {
   const cmMakefile* mf
@@ -433,13 +456,16 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile()
   // set natures for c/c++ projects
   fout <<
     "\t<natures>\n"
-    // TODO: ccnature only if it is c++ ???
-    "\t\t<nature>org.eclipse.cdt.core.ccnature</nature>\n"
     "\t\t<nature>org.eclipse.cdt.make.core.makeNature</nature>\n"
-    "\t\t<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>\n"
-    "\t\t<nature>org.eclipse.cdt.core.cnature</nature>\n"
-    "\t</natures>\n"
-    ;
+    "\t\t<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>\n";
+
+  for (std::set<std::string>::const_iterator nit=this->Natures.begin();
+       nit != this->Natures.end(); ++nit)
+    {
+    fout << "\t\t<nature>" << *nit << "</nature>\n";
+    }
+
+  fout << "\t</natures>\n";
 
   fout << "\t<linkedResources>\n";
   // create linked resources
diff --git a/Source/cmExtraEclipseCDT4Generator.h b/Source/cmExtraEclipseCDT4Generator.h
index b31cce7..9c89f85 100644
--- a/Source/cmExtraEclipseCDT4Generator.h
+++ b/Source/cmExtraEclipseCDT4Generator.h
@@ -41,6 +41,8 @@ public:
 
   virtual void GetDocumentation(cmDocumentationEntry& entry,
                                 const char*           fullName) const;
+  virtual void EnableLanguage(std::vector<std::string> const& languages,
+                              cmMakefile *, bool optional);
 
   virtual void Generate();
 
@@ -105,6 +107,7 @@ private:
   void CreateLinksForTargets(cmGeneratedFileStream& fout);
 
   std::vector<std::string> SrcLinkedResources;
+  std::set<std::string> Natures;
   std::string HomeDirectory;
   std::string HomeOutputDirectory;
   bool IsOutOfSourceBuild;

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4a352d43bbe3c8726046683e7dbc89a55b5e1c67
commit 4a352d43bbe3c8726046683e7dbc89a55b5e1c67
Author:     Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Thu Aug 29 14:43:54 2013 -0400
Commit:     Ben Boeckel <ben.boeckel at kitware.com>
CommitDate: Tue Nov 19 11:48:18 2013 -0500

    Notify extra generators about languages
    
    Some generators can use the any enabled languages to add extra support
    in the relevant build tool. One such is Eclipse since there are many
    plugins available for various languages.

diff --git a/Source/cmExternalMakefileProjectGenerator.cxx b/Source/cmExternalMakefileProjectGenerator.cxx
index 9c965cc..0d42c35 100644
--- a/Source/cmExternalMakefileProjectGenerator.cxx
+++ b/Source/cmExternalMakefileProjectGenerator.cxx
@@ -13,6 +13,12 @@
 
 #include "cmExternalMakefileProjectGenerator.h"
 
+void cmExternalMakefileProjectGenerator
+::EnableLanguage(std::vector<std::string> const&,
+                 cmMakefile *, bool)
+{
+}
+
 std::string cmExternalMakefileProjectGenerator::CreateFullGeneratorName(
                                                    const char* globalGenerator,
                                                    const char* extraGenerator)
diff --git a/Source/cmExternalMakefileProjectGenerator.h b/Source/cmExternalMakefileProjectGenerator.h
index 182c1a8..bce441d 100644
--- a/Source/cmExternalMakefileProjectGenerator.h
+++ b/Source/cmExternalMakefileProjectGenerator.h
@@ -41,6 +41,8 @@ public:
   /** Get the documentation entry for this generator.  */
   virtual void GetDocumentation(cmDocumentationEntry& entry,
                                 const char* fullName) const = 0;
+  virtual void EnableLanguage(std::vector<std::string> const& languages,
+                              cmMakefile *, bool optional);
 
   ///! set the global generator which will generate the makefiles
   virtual void SetGlobalGenerator(cmGlobalGenerator* generator)
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 65a7118..56db0ef 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -695,6 +695,11 @@ cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages,
     {
     mf->ReadListFile(0,projectCompatibility.c_str());
     }
+  // Inform any extra generator of the new language.
+  if (this->ExtraGenerator)
+    {
+    this->ExtraGenerator->EnableLanguage(languages, mf, false);
+    }
 
   if(fatalError)
     {

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

Summary of changes:
 Help/manual/cmake-properties.7.rst            |    1 +
 Help/prop_gbl/ECLIPSE_EXTRA_NATURES.rst       |    8 ++++
 Source/cmExternalMakefileProjectGenerator.cxx |    6 +++
 Source/cmExternalMakefileProjectGenerator.h   |    2 +
 Source/cmExtraEclipseCDT4Generator.cxx        |   50 ++++++++++++++++++++++---
 Source/cmExtraEclipseCDT4Generator.h          |    3 +
 Source/cmGlobalGenerator.cxx                  |    5 ++
 7 files changed, 69 insertions(+), 6 deletions(-)
 create mode 100644 Help/prop_gbl/ECLIPSE_EXTRA_NATURES.rst


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list