diff options
author | David Cole <david.cole@kitware.com> | 2012-10-17 20:44:53 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2012-10-17 20:44:53 (GMT) |
commit | f3b8049884354e166249f40c15df5a4907ace4ac (patch) | |
tree | 8cf89afdbdafcb2ba4b18ace2c87b4665db0b6ad /Source | |
parent | 982905c0d23aded548718cf64665002cac350e77 (diff) | |
parent | 2a6bd96c1354484b4f9e71d11422f8da028c1622 (diff) | |
download | CMake-f3b8049884354e166249f40c15df5a4907ace4ac.zip CMake-f3b8049884354e166249f40c15df5a4907ace4ac.tar.gz CMake-f3b8049884354e166249f40c15df5a4907ace4ac.tar.bz2 |
Merge topic 'fix-INCLUDE_DIRECTORIES-multiconfig'
2a6bd96 Fix config-specific INCLUDE_DIRECTORIES in multi-config generators
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmExtraCodeBlocksGenerator.cxx | 4 | ||||
-rw-r--r-- | Source/cmExtraEclipseCDT4Generator.cxx | 3 | ||||
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 4 | ||||
-rw-r--r-- | Source/cmGeneratorTarget.h | 2 | ||||
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 3 | ||||
-rw-r--r-- | Source/cmLocalGenerator.cxx | 5 | ||||
-rw-r--r-- | Source/cmLocalGenerator.h | 2 | ||||
-rw-r--r-- | Source/cmLocalVisualStudio6Generator.cxx | 26 | ||||
-rw-r--r-- | Source/cmLocalVisualStudio6Generator.h | 2 | ||||
-rw-r--r-- | Source/cmLocalVisualStudio7Generator.cxx | 2 | ||||
-rw-r--r-- | Source/cmMakefileTargetGenerator.cxx | 18 | ||||
-rw-r--r-- | Source/cmNinjaTargetGenerator.cxx | 6 | ||||
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 7 |
13 files changed, 59 insertions, 25 deletions
diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx index 00e1abc..25b13e5 100644 --- a/Source/cmExtraCodeBlocksGenerator.cxx +++ b/Source/cmExtraCodeBlocksGenerator.cxx @@ -640,8 +640,10 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout, std::set<std::string> uniqIncludeDirs; std::vector<std::string> includes; + const char *config = target->GetMakefile() + ->GetDefinition("CMAKE_BUILD_TYPE"); target->GetMakefile()->GetLocalGenerator()-> - GetIncludeDirectories(includes, gtgt); + GetIncludeDirectories(includes, gtgt, "C", config); for(std::vector<std::string>::const_iterator dirIt=includes.begin(); dirIt != includes.end(); ++dirIt) diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index f1d9c31..689f213 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -890,7 +890,8 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const l != targets.end(); ++l) { std::vector<std::string> includeDirs; - (*it)->GetIncludeDirectories(includeDirs, l->second); + const char *config = mf->GetDefinition("CMAKE_BUILD_TYPE"); + (*it)->GetIncludeDirectories(includeDirs, l->second, "C", config); this->AppendIncludeDirectories(fout, includeDirs, emmited); } } diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index d4b57f4..19b55c6 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -287,7 +287,8 @@ const char* cmGeneratorTarget::GetCreateRuleVariable() } //---------------------------------------------------------------------------- -std::vector<std::string> cmGeneratorTarget::GetIncludeDirectories() +std::vector<std::string> cmGeneratorTarget::GetIncludeDirectories( + const char *config) { std::vector<std::string> includes; const char *prop = this->Target->GetProperty("INCLUDE_DIRECTORIES"); @@ -296,7 +297,6 @@ std::vector<std::string> cmGeneratorTarget::GetIncludeDirectories() return includes; } - const char *config = this->Makefile->GetDefinition("CMAKE_BUILD_TYPE"); cmListFileBacktrace lfbt; cmGeneratorExpression ge(lfbt); diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index 8ea17d7..a29a9f9 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -72,7 +72,7 @@ public: const char* GetCreateRuleVariable(); /** Get the include directories for this target. */ - std::vector<std::string> GetIncludeDirectories(); + std::vector<std::string> GetIncludeDirectories(const char *config); std::string GetCompileDefinitions(const char *config = 0); diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 95c6807..30d8f18 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -1947,7 +1947,8 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target, BuildObjectListOrString dirs(this, this->XcodeVersion >= 30); BuildObjectListOrString fdirs(this, this->XcodeVersion >= 30); std::vector<std::string> includes; - this->CurrentLocalGenerator->GetIncludeDirectories(includes, gtgt); + this->CurrentLocalGenerator->GetIncludeDirectories(includes, gtgt, + "C", configName); std::set<cmStdString> emitted; emitted.insert("/System/Library/Frameworks"); for(std::vector<std::string>::iterator i = includes.begin(); diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index c7995a3..4f4f725 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1324,7 +1324,8 @@ std::string cmLocalGenerator::GetIncludeFlags( //---------------------------------------------------------------------------- void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs, cmGeneratorTarget* target, - const char* lang) + const char* lang, + const char *config) { // Need to decide whether to automatically include the source and // binary directories at the beginning of the include path. @@ -1417,7 +1418,7 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs, // Get the target-specific include directories. std::vector<std::string> includes; - includes = target->GetIncludeDirectories(); + includes = target->GetIncludeDirectories(config); // Support putting all the in-project include directories first if // it is requested by the project. diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index 49bce38..bd58218 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -212,7 +212,7 @@ public: /** Get the include flags for the current makefile and language. */ void GetIncludeDirectories(std::vector<std::string>& dirs, cmGeneratorTarget* target, - const char* lang = "C"); + const char* lang = "C", const char *config = 0); /** Compute the language used to compile the given source file. */ const char* GetSourceFileLanguage(const cmSourceFile& source); diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx index 72b56e7..f15322b 100644 --- a/Source/cmLocalVisualStudio6Generator.cxx +++ b/Source/cmLocalVisualStudio6Generator.cxx @@ -853,7 +853,8 @@ inline std::string removeQuotes(const std::string& s) std::string -cmLocalVisualStudio6Generator::GetTargetIncludeOptions(cmTarget &target) +cmLocalVisualStudio6Generator::GetTargetIncludeOptions(cmTarget &target, + const char *config) { std::string includeOptions; @@ -868,7 +869,7 @@ cmLocalVisualStudio6Generator::GetTargetIncludeOptions(cmTarget &target) for(int j=0; j < 2; ++j) { std::vector<std::string> includes; - this->GetIncludeDirectories(includes, gt); + this->GetIncludeDirectories(includes, gt, "C", config); std::vector<std::string>::iterator i; for(i = includes.begin(); i != includes.end(); ++i) @@ -1147,7 +1148,15 @@ void cmLocalVisualStudio6Generator #endif // Get include options for this target. - std::string includeOptions = this->GetTargetIncludeOptions(target); + std::string includeOptionsDebug = this->GetTargetIncludeOptions(target, + "DEBUG"); + std::string includeOptionsRelease = this->GetTargetIncludeOptions(target, + "RELEASE"); + std::string includeOptionsRelWithDebInfo = this->GetTargetIncludeOptions( + target, + "RELWITHDEBINFO"); + std::string includeOptionsMinSizeRel = this->GetTargetIncludeOptions(target, + "MINSIZEREL"); // Get extra linker options for this target type. std::string extraLinkOptions; @@ -1560,8 +1569,15 @@ void cmLocalVisualStudio6Generator cmSystemTools::ReplaceString(line, "CM_MULTILINE_OPTIONS_RELWITHDEBINFO", optionsRelWithDebInfo.c_str()); - cmSystemTools::ReplaceString(line, "BUILD_INCLUDES", - includeOptions.c_str()); + cmSystemTools::ReplaceString(line, "BUILD_INCLUDES_DEBUG", + includeOptionsDebug.c_str()); + cmSystemTools::ReplaceString(line, "BUILD_INCLUDES_RELEASE", + includeOptionsRelease.c_str()); + cmSystemTools::ReplaceString(line, "BUILD_INCLUDES_MINSIZEREL", + includeOptionsMinSizeRel.c_str()); + cmSystemTools::ReplaceString(line, "BUILD_INCLUDES_RELWITHDEBINFO", + includeOptionsRelWithDebInfo.c_str()); + cmSystemTools::ReplaceString(line, "TARGET_VERSION_FLAG", targetVersionFlag.c_str()); cmSystemTools::ReplaceString(line, "TARGET_IMPLIB_FLAG_DEBUG", diff --git a/Source/cmLocalVisualStudio6Generator.h b/Source/cmLocalVisualStudio6Generator.h index 9315d97..f45bc17 100644 --- a/Source/cmLocalVisualStudio6Generator.h +++ b/Source/cmLocalVisualStudio6Generator.h @@ -90,7 +90,7 @@ private: std::string& options); void OutputObjects(cmTarget& target, const char* tool, std::string& options); - std::string GetTargetIncludeOptions(cmTarget &target); + std::string GetTargetIncludeOptions(cmTarget &target, const char *config); std::vector<std::string> Configurations; std::string GetConfigName(std::string const& configuration) const; diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 33d6e05..f9a2d32 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -814,7 +814,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout, targetOptions.OutputAdditionalOptions(fout, "\t\t\t\t", "\n"); fout << "\t\t\t\tAdditionalIncludeDirectories=\""; std::vector<std::string> includes; - this->GetIncludeDirectories(includes, gt); + this->GetIncludeDirectories(includes, gt, "C", configName); std::vector<std::string>::iterator i = includes.begin(); for(;i != includes.end(); ++i) { diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 5cc67e2..3d02d6a 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -1057,8 +1057,11 @@ void cmMakefileTargetGenerator::WriteTargetDependRules() *this->InfoFileStream << "SET(CMAKE_C_TARGET_INCLUDE_PATH\n"; std::vector<std::string> includes; + + const char *config = this->Makefile->GetDefinition("CMAKE_BUILD_TYPE"); this->LocalGenerator->GetIncludeDirectories(includes, - this->GeneratorTarget); + this->GeneratorTarget, + "C", config); for(std::vector<std::string>::iterator i = includes.begin(); i != includes.end(); ++i) { @@ -1543,8 +1546,11 @@ std::string cmMakefileTargetGenerator::GetFrameworkFlags() emitted.insert("/System/Library/Frameworks"); #endif std::vector<std::string> includes; + + const char *config = this->Makefile->GetDefinition("CMAKE_BUILD_TYPE"); this->LocalGenerator->GetIncludeDirectories(includes, - this->GeneratorTarget); + this->GeneratorTarget, + "C", config); std::vector<std::string>::iterator i; // check all include directories for frameworks as this // will already have added a -F for the framework @@ -1849,8 +1855,10 @@ void cmMakefileTargetGenerator::AddIncludeFlags(std::string& flags, std::vector<std::string> includes; + const char *config = this->Makefile->GetDefinition("CMAKE_BUILD_TYPE"); this->LocalGenerator->GetIncludeDirectories(includes, - this->GeneratorTarget, lang); + this->GeneratorTarget, + lang, config); std::string includeFlags = this->LocalGenerator->GetIncludeFlags(includes, lang, useResponseFile); @@ -1953,8 +1961,10 @@ void cmMakefileTargetGenerator::AddFortranFlags(std::string& flags) this->Makefile->GetDefinition("CMAKE_Fortran_MODPATH_FLAG")) { std::vector<std::string> includes; + const char *config = this->Makefile->GetDefinition("CMAKE_BUILD_TYPE"); this->LocalGenerator->GetIncludeDirectories(includes, - this->GeneratorTarget); + this->GeneratorTarget, + "C", config); for(std::vector<std::string>::const_iterator idi = includes.begin(); idi != includes.end(); ++idi) { diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 39f6aab..0f10152 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -152,8 +152,10 @@ cmNinjaTargetGenerator::ComputeFlagsForObject(cmSourceFile *source, // Add include directory flags. { std::vector<std::string> includes; - this->LocalGenerator->GetIncludeDirectories(includes, this->GeneratorTarget, - language.c_str()); + const char *config = this->Makefile->GetDefinition("CMAKE_BUILD_TYPE"); + this->LocalGenerator->GetIncludeDirectories(includes, + this->GeneratorTarget, + language.c_str(), config); std::string includeFlags = this->LocalGenerator->GetIncludeFlags(includes, language.c_str(), language == "RC" ? true : false); // full include paths for RC diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index ab57a32..1e37ca5 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -1586,12 +1586,13 @@ void cmVisualStudio10TargetGenerator::WriteItemDefinitionGroups() std::vector<std::string> *configs = static_cast<cmGlobalVisualStudio7Generator *> (this->GlobalGenerator)->GetConfigurations(); - std::vector<std::string> includes; - this->LocalGenerator->GetIncludeDirectories(includes, - this->GeneratorTarget); for(std::vector<std::string>::iterator i = configs->begin(); i != configs->end(); ++i) { + std::vector<std::string> includes; + this->LocalGenerator->GetIncludeDirectories(includes, + this->GeneratorTarget, + "C", i->c_str()); this->WritePlatformConfigTag("ItemDefinitionGroup", i->c_str(), 1); *this->BuildFileStream << "\n"; // output cl compile flags <ClCompile></ClCompile> |