summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-02-25 14:00:24 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2016-02-25 14:00:24 (GMT)
commitc842411dc5a2123cdc9d949b67f8421379a4a928 (patch)
treee527fe452a975215428eecf517c0b68abb6c818f /Source
parentdd99bfff3a25668c2043e776d775f7ebaef82d03 (diff)
parentaff38945d64fc56026255c9cc3c1051529887d7b (diff)
downloadCMake-c842411dc5a2123cdc9d949b67f8421379a4a928.zip
CMake-c842411dc5a2123cdc9d949b67f8421379a4a928.tar.gz
CMake-c842411dc5a2123cdc9d949b67f8421379a4a928.tar.bz2
Merge topic 'AddNewEclipseVersions'
aff38945 Eclipse: only add C/CXX macros if the language is enabled 6ee6b17e Eclipse: add newer version numbers
Diffstat (limited to 'Source')
-rw-r--r--Source/cmExtraEclipseCDT4Generator.cxx12
-rw-r--r--Source/cmExtraEclipseCDT4Generator.h2
2 files changed, 10 insertions, 4 deletions
diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx
index aedf6f4..133a85a 100644
--- a/Source/cmExtraEclipseCDT4Generator.cxx
+++ b/Source/cmExtraEclipseCDT4Generator.cxx
@@ -42,6 +42,8 @@ cmExtraEclipseCDT4Generator
this->GenerateLinkedResources = true;
this->SupportsGmakeErrorParser = true;
this->SupportsMachO64Parser = true;
+ this->CEnabled = false;
+ this->CXXEnabled = false;
}
//----------------------------------------------------------------------------
@@ -64,10 +66,12 @@ void cmExtraEclipseCDT4Generator
{
this->Natures.insert("org.eclipse.cdt.core.ccnature");
this->Natures.insert("org.eclipse.cdt.core.cnature");
+ this->CXXEnabled = true;
}
else if (*lit == "C")
{
this->Natures.insert("org.eclipse.cdt.core.cnature");
+ this->CEnabled = true;
}
else if (*lit == "Java")
{
@@ -890,7 +894,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
// add system defined c macros
const char* cDefs=mf->GetDefinition(
"CMAKE_EXTRA_GENERATOR_C_SYSTEM_DEFINED_MACROS");
- if(cDefs)
+ if(this->CEnabled && cDefs)
{
// Expand the list.
std::vector<std::string> defs;
@@ -925,7 +929,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
// add system defined c++ macros
const char* cxxDefs = mf->GetDefinition(
"CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_DEFINED_MACROS");
- if(cxxDefs)
+ if(this->CXXEnabled && cxxDefs)
{
// Expand the list.
std::vector<std::string> defs;
@@ -979,7 +983,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
// CMakeSystemSpecificInformation.cmake. This makes Eclipse find the
// standard headers.
std::string compiler = mf->GetSafeDefinition("CMAKE_C_COMPILER");
- if (!compiler.empty())
+ if (this->CEnabled && !compiler.empty())
{
std::string systemIncludeDirs = mf->GetSafeDefinition(
"CMAKE_EXTRA_GENERATOR_C_SYSTEM_INCLUDE_DIRS");
@@ -988,7 +992,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
this->AppendIncludeDirectories(fout, dirs, emmited);
}
compiler = mf->GetSafeDefinition("CMAKE_CXX_COMPILER");
- if (!compiler.empty())
+ if (this->CXXEnabled && !compiler.empty())
{
std::string systemIncludeDirs = mf->GetSafeDefinition(
"CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_INCLUDE_DIRS");
diff --git a/Source/cmExtraEclipseCDT4Generator.h b/Source/cmExtraEclipseCDT4Generator.h
index 16675f2..1da2077 100644
--- a/Source/cmExtraEclipseCDT4Generator.h
+++ b/Source/cmExtraEclipseCDT4Generator.h
@@ -116,6 +116,8 @@ private:
bool SupportsVirtualFolders;
bool SupportsGmakeErrorParser;
bool SupportsMachO64Parser;
+ bool CEnabled;
+ bool CXXEnabled;
};