diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2013-08-29 18:51:59 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2013-11-19 16:48:19 (GMT) |
commit | a990722b5a8fc15058e7024ec54885ec24ed4bbf (patch) | |
tree | 3ddf0c80cf389cc89adbbb0cb7c89e58b2fe85bf | |
parent | 51726cce64ee8bce1115f3c6d092b4ae6f43d714 (diff) | |
download | CMake-a990722b5a8fc15058e7024ec54885ec24ed4bbf.zip CMake-a990722b5a8fc15058e7024ec54885ec24ed4bbf.tar.gz CMake-a990722b5a8fc15058e7024ec54885ec24ed4bbf.tar.bz2 |
eclipse: Support custom natures via a global property
This is useful for enabling natures not recognized by the Eclipse
generator directly in a project.
-rw-r--r-- | Help/manual/cmake-properties.7.rst | 1 | ||||
-rw-r--r-- | Help/prop_gbl/ECLIPSE_EXTRA_NATURES.rst | 8 | ||||
-rw-r--r-- | Source/cmExtraEclipseCDT4Generator.cxx | 12 |
3 files changed, 21 insertions, 0 deletions
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"; |