summaryrefslogtreecommitdiffstats
path: root/Source/cmExtraCodeBlocksGenerator.cxx
diff options
context:
space:
mode:
authorAlex Neundorf <neundorf@kde.org>2011-07-29 21:51:31 (GMT)
committerAlex Neundorf <neundorf@kde.org>2011-07-29 21:51:31 (GMT)
commita5683f80bdc1c8c78d8db47f5695e0be3cc19afe (patch)
tree84d8452f249fabd728d75026c08e4b1c3986fc43 /Source/cmExtraCodeBlocksGenerator.cxx
parent5ef20b2dc54474ceba1c81a75e8c3fc558d505fa (diff)
downloadCMake-a5683f80bdc1c8c78d8db47f5695e0be3cc19afe.zip
CMake-a5683f80bdc1c8c78d8db47f5695e0be3cc19afe.tar.gz
CMake-a5683f80bdc1c8c78d8db47f5695e0be3cc19afe.tar.bz2
Patch by Campbell Barton: puts definitions into C::B project file
This enables Codeblocks and QtCreator to do proper highlighting based on defined macros. Alex
Diffstat (limited to 'Source/cmExtraCodeBlocksGenerator.cxx')
-rw-r--r--Source/cmExtraCodeBlocksGenerator.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx
index 4f93067..7db91c7 100644
--- a/Source/cmExtraCodeBlocksGenerator.cxx
+++ b/Source/cmExtraCodeBlocksGenerator.cxx
@@ -573,6 +573,22 @@ 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
const std::vector<std::string>& incDirs =
target->GetMakefile()->GetIncludeDirectories();