summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefileTargetGenerator.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmMakefileTargetGenerator.cxx')
-rw-r--r--Source/cmMakefileTargetGenerator.cxx35
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)
{