summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorAlex Neundorf <neundorf@kde.org>2011-08-01 23:46:39 (GMT)
committerAlex Neundorf <neundorf@kde.org>2011-08-01 23:46:39 (GMT)
commite2e8c0a41225f5449a8139a1ce0219940f902665 (patch)
treea62a704f398e37765df0a50361b58b5f41be9471 /Source
parent92c0dc50fc73dd9866f48c521b0aff7473eb3a59 (diff)
downloadCMake-e2e8c0a41225f5449a8139a1ce0219940f902665.zip
CMake-e2e8c0a41225f5449a8139a1ce0219940f902665.tar.gz
CMake-e2e8c0a41225f5449a8139a1ce0219940f902665.tar.bz2
Also put builtin include dirs into CodeBlocks project file
Refactor code from CMakeFindEclipseCDT4.cmake so it can be used alkso for CodeBlocks, and move it into new file CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake. Alex
Diffstat (limited to 'Source')
-rw-r--r--Source/cmExtraCodeBlocksGenerator.cxx38
-rw-r--r--Source/cmExtraEclipseCDT4Generator.cxx9
2 files changed, 43 insertions, 4 deletions
diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx
index 7db91c7..c7fe8f9 100644
--- a/Source/cmExtraCodeBlocksGenerator.cxx
+++ b/Source/cmExtraCodeBlocksGenerator.cxx
@@ -590,14 +590,52 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
}
// the include directories for this target
+ std::set<std::string> uniqIncludeDirs;
const std::vector<std::string>& incDirs =
target->GetMakefile()->GetIncludeDirectories();
for(std::vector<std::string>::const_iterator dirIt=incDirs.begin();
dirIt != incDirs.end();
++dirIt)
{
+ uniqIncludeDirs.insert(*dirIt);
+ }
+
+
+ std::string systemIncludeDirs = makefile->GetSafeDefinition(
+ "CMAKE_EXTRA_GENERATOR_C_SYSTEM_INCLUDE_DIRS");
+ if (!systemIncludeDirs.empty())
+ {
+ std::vector<std::string> dirs;
+ cmSystemTools::ExpandListArgument(systemIncludeDirs.c_str(), dirs);
+ for(std::vector<std::string>::const_iterator dirIt=dirs.begin();
+ dirIt != dirs.end();
+ ++dirIt)
+ {
+ uniqIncludeDirs.insert(*dirIt);
+ }
+ }
+
+ systemIncludeDirs = makefile->GetSafeDefinition(
+ "CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_INCLUDE_DIRS");
+ if (!systemIncludeDirs.empty())
+ {
+ std::vector<std::string> dirs;
+ cmSystemTools::ExpandListArgument(systemIncludeDirs.c_str(), dirs);
+ for(std::vector<std::string>::const_iterator dirIt=dirs.begin();
+ dirIt != dirs.end();
+ ++dirIt)
+ {
+ uniqIncludeDirs.insert(*dirIt);
+ }
+ }
+
+ for(std::set<std::string>::const_iterator dirIt=uniqIncludeDirs.begin();
+ dirIt != uniqIncludeDirs.end();
+ ++dirIt)
+ {
fout <<" <Add directory=\"" << dirIt->c_str() << "\" />\n";
}
+
fout<<" </Compiler>\n";
}
else // e.g. all and the GLOBAL and UTILITY targets
diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx
index f6960ff..1dd9bf3 100644
--- a/Source/cmExtraEclipseCDT4Generator.cxx
+++ b/Source/cmExtraEclipseCDT4Generator.cxx
@@ -654,7 +654,8 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
}
}
// add system defined c macros
- const char* cDefs=mf->GetDefinition("CMAKE_ECLIPSE_C_SYSTEM_DEFINED_MACROS");
+ const char* cDefs=mf->GetDefinition(
+ "CMAKE_EXTRA_GENERATOR_C_SYSTEM_DEFINED_MACROS");
if(cDefs)
{
// Expand the list.
@@ -689,7 +690,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
}
// add system defined c++ macros
const char* cxxDefs = mf->GetDefinition(
- "CMAKE_ECLIPSE_CXX_SYSTEM_DEFINED_MACROS");
+ "CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_DEFINED_MACROS");
if(cxxDefs)
{
// Expand the list.
@@ -741,7 +742,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
if (!compiler.empty())
{
std::string systemIncludeDirs = mf->GetSafeDefinition(
- "CMAKE_ECLIPSE_C_SYSTEM_INCLUDE_DIRS");
+ "CMAKE_EXTRA_GENERATOR_C_SYSTEM_INCLUDE_DIRS");
std::vector<std::string> dirs;
cmSystemTools::ExpandListArgument(systemIncludeDirs.c_str(), dirs);
this->AppendIncludeDirectories(fout, dirs, emmited);
@@ -750,7 +751,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
if (!compiler.empty())
{
std::string systemIncludeDirs = mf->GetSafeDefinition(
- "CMAKE_ECLIPSE_CXX_SYSTEM_INCLUDE_DIRS");
+ "CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_INCLUDE_DIRS");
std::vector<std::string> dirs;
cmSystemTools::ExpandListArgument(systemIncludeDirs.c_str(), dirs);
this->AppendIncludeDirectories(fout, dirs, emmited);