diff options
author | Stephen Kelly <steveire@gmail.com> | 2011-11-05 15:17:49 (GMT) |
---|---|---|
committer | David Cole <david.cole@kitware.com> | 2012-02-22 11:31:50 (GMT) |
commit | 9106b564ae5bf0bf1c1ff4a3fca484bcfd40e183 (patch) | |
tree | 26d6a7889a9fcafa83a4d7f8f8d48d37db0bee68 /Source/cmMakefileTargetGenerator.cxx | |
parent | 840509babb2d1c8fc5167c4580fef58546c06700 (diff) | |
download | CMake-9106b564ae5bf0bf1c1ff4a3fca484bcfd40e183.zip CMake-9106b564ae5bf0bf1c1ff4a3fca484bcfd40e183.tar.gz CMake-9106b564ae5bf0bf1c1ff4a3fca484bcfd40e183.tar.bz2 |
Extract and use the INCLUDE_DIRECTORIES target properties.
Eliminate callers of cmMakefile::GetIncludeDirectories.
All callers of GetIncludeDirectories should go through the local generator
object.
Only the local generator calls cmTarget::GetIncludeDirectories directly.
Diffstat (limited to 'Source/cmMakefileTargetGenerator.cxx')
-rw-r--r-- | Source/cmMakefileTargetGenerator.cxx | 35 |
1 files changed, 32 insertions, 3 deletions
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index dd982fb..e5be4aa 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -1069,6 +1069,35 @@ void cmMakefileTargetGenerator::WriteTargetDependRules() << "SET(CMAKE_Fortran_TARGET_MODULE_DIR \"" << mdir << "\")\n"; } + // Target-specific include directories: + *this->InfoFileStream + << "\n" + << "# The include file search paths:\n"; + *this->InfoFileStream + << "SET(CMAKE_C_TARGET_INCLUDE_PATH\n"; + std::vector<std::string> includes; + this->LocalGenerator->GetIncludeDirectories(includes, this->Target); + for(std::vector<std::string>::iterator i = includes.begin(); + i != includes.end(); ++i) + { + *this->InfoFileStream + << " \"" + << this->LocalGenerator->Convert(i->c_str(), + cmLocalGenerator::HOME_OUTPUT) + << "\"\n"; + } + *this->InfoFileStream + << " )\n"; + *this->InfoFileStream + << "SET(CMAKE_CXX_TARGET_INCLUDE_PATH " + << "${CMAKE_C_TARGET_INCLUDE_PATH})\n"; + *this->InfoFileStream + << "SET(CMAKE_Fortran_TARGET_INCLUDE_PATH " + << "${CMAKE_C_TARGET_INCLUDE_PATH})\n"; + *this->InfoFileStream + << "SET(CMAKE_ASM_TARGET_INCLUDE_PATH " + << "${CMAKE_C_TARGET_INCLUDE_PATH})\n"; + // and now write the rule to use it std::vector<std::string> depends; std::vector<std::string> commands; @@ -1534,7 +1563,7 @@ std::string cmMakefileTargetGenerator::GetFrameworkFlags() emitted.insert("/System/Library/Frameworks"); #endif std::vector<std::string> includes; - this->LocalGenerator->GetIncludeDirectories(includes); + this->LocalGenerator->GetIncludeDirectories(includes, this->Target); std::vector<std::string>::iterator i; // check all include directories for frameworks as this // will already have added a -F for the framework @@ -1831,7 +1860,7 @@ void cmMakefileTargetGenerator::AddIncludeFlags(std::string& flags, std::vector<std::string> includes; - this->LocalGenerator->GetIncludeDirectories(includes, lang); + this->LocalGenerator->GetIncludeDirectories(includes, this->Target, lang); std::string includeFlags = this->LocalGenerator->GetIncludeFlags(includes, lang, useResponseFile); @@ -1934,7 +1963,7 @@ void cmMakefileTargetGenerator::AddFortranFlags(std::string& flags) this->Makefile->GetDefinition("CMAKE_Fortran_MODPATH_FLAG")) { std::vector<std::string> includes; - this->LocalGenerator->GetIncludeDirectories(includes); + this->LocalGenerator->GetIncludeDirectories(includes, this->Target); for(std::vector<std::string>::const_iterator idi = includes.begin(); idi != includes.end(); ++idi) { |