summaryrefslogtreecommitdiffstats
path: root/Source/cmExtraCodeBlocksGenerator.cxx
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2011-08-02 19:11:58 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2011-08-02 19:11:58 (GMT)
commit80ef23d83fbf534bb3488db69a284fedf2be17e4 (patch)
tree74ac55b9f1a34821d7b408b7683dcf68775480f2 /Source/cmExtraCodeBlocksGenerator.cxx
parent6a117271545d40b7d9615e840ba89d959e0b758d (diff)
parente2e8c0a41225f5449a8139a1ce0219940f902665 (diff)
downloadCMake-80ef23d83fbf534bb3488db69a284fedf2be17e4.zip
CMake-80ef23d83fbf534bb3488db69a284fedf2be17e4.tar.gz
CMake-80ef23d83fbf534bb3488db69a284fedf2be17e4.tar.bz2
Merge topic 'CodeBlocksIncludeDirsAndDefines'
e2e8c0a Also put builtin include dirs into CodeBlocks project file 92c0dc5 Remove useless line of code a5683f8 Patch by Campbell Barton: puts definitions into C::B project file
Diffstat (limited to 'Source/cmExtraCodeBlocksGenerator.cxx')
-rw-r--r--Source/cmExtraCodeBlocksGenerator.cxx54
1 files changed, 54 insertions, 0 deletions
diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx
index 28ea10a..92dee5a 100644
--- a/Source/cmExtraCodeBlocksGenerator.cxx
+++ b/Source/cmExtraCodeBlocksGenerator.cxx
@@ -580,15 +580,69 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
" <Option type=\"" << cbTargetType << "\" />\n"
" <Option compiler=\"" << compiler << "\" />\n"
" <Compiler>\n";
+
+ // the compilerdefines for this target
+ const char* cdefs = target->GetMakefile()->GetProperty(
+ "COMPILE_DEFINITIONS");
+ if(cdefs)
+ {
+ // Expand the list.
+ std::vector<std::string> defs;
+ cmSystemTools::ExpandListArgument(cdefs, defs);
+ for(std::vector<std::string>::const_iterator di = defs.begin();
+ di != defs.end(); ++di)
+ {
+ fout <<" <Add option=\"-D" << di->c_str() << "\" />\n";
+ }
+ }
+
// 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