diff options
author | David Cole <david.cole@kitware.com> | 2011-08-02 19:11:58 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2011-08-02 19:11:58 (GMT) |
commit | 80ef23d83fbf534bb3488db69a284fedf2be17e4 (patch) | |
tree | 74ac55b9f1a34821d7b408b7683dcf68775480f2 /Source | |
parent | 6a117271545d40b7d9615e840ba89d959e0b758d (diff) | |
parent | e2e8c0a41225f5449a8139a1ce0219940f902665 (diff) | |
download | CMake-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')
-rw-r--r-- | Source/cmExtraCodeBlocksGenerator.cxx | 54 | ||||
-rw-r--r-- | Source/cmExtraEclipseCDT4Generator.cxx | 10 |
2 files changed, 59 insertions, 5 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 diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index 8e26b8e..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. @@ -737,12 +738,11 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const // now also the system include directories, in case we found them in // CMakeSystemSpecificInformation.cmake. This makes Eclipse find the // standard headers. - mf->GetDefinition("CMAKE_ECLIPSE_C_SYSTEM_INCLUDE_DIRS"); std::string compiler = mf->GetSafeDefinition("CMAKE_C_COMPILER"); 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); @@ -751,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); |