summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGeneratorExpressionEvaluator.cxx3
-rw-r--r--Source/cmGeneratorTarget.cxx5
-rw-r--r--Source/cmGeneratorTarget.h2
-rw-r--r--Source/cmLocalGenerator.cxx2
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx26
-rw-r--r--Source/cmMakefileTargetGenerator.cxx34
-rw-r--r--Source/cmTarget.cxx14
-rw-r--r--Source/cmTarget.h3
8 files changed, 44 insertions, 45 deletions
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index 3ec8595..756d932 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -851,7 +851,8 @@ static const struct CompileLanguageNode : public cmGeneratorExpressionNode
}
else if (genName.find("Xcode") != std::string::npos)
{
- if (dagChecker && dagChecker->EvaluatingCompileDefinitions())
+ if (dagChecker && (dagChecker->EvaluatingCompileDefinitions()
+ || dagChecker->EvaluatingIncludeDirectories()))
{
reportError(context, content->GetOriginalExpression(),
"$<COMPILE_LANGUAGE:...> may only be used with COMPILE_OPTIONS "
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 44c9e9a..b7b2eff 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -960,9 +960,10 @@ cmGeneratorTarget::GetCreateRuleVariable(std::string const& lang,
//----------------------------------------------------------------------------
std::vector<std::string>
-cmGeneratorTarget::GetIncludeDirectories(const std::string& config) const
+cmGeneratorTarget::GetIncludeDirectories(const std::string& config,
+ const std::string& lang) const
{
- return this->Target->GetIncludeDirectories(config);
+ return this->Target->GetIncludeDirectories(config, lang);
}
//----------------------------------------------------------------------------
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 2083b88..c329cf5 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -85,7 +85,7 @@ public:
/** Get the include directories for this target. */
std::vector<std::string> GetIncludeDirectories(
- const std::string& config) const;
+ const std::string& config, const std::string& lang) const;
bool IsSystemIncludeDirectory(const std::string& dir,
const std::string& config) const;
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 735dfa9..37cc2c6 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1600,7 +1600,7 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
// Get the target-specific include directories.
std::vector<std::string> includes;
- includes = target->GetIncludeDirectories(config);
+ includes = target->GetIncludeDirectories(config, lang);
// Support putting all the in-project include directories first if
// it is requested by the project.
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 9ecb029..50491af 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -2114,6 +2114,32 @@ void cmLocalUnixMakefileGenerator3
cmakefileStream
<< " )\n";
}
+
+ // Target-specific include directories:
+ cmakefileStream
+ << "\n"
+ << "# The include file search paths:\n";
+ cmakefileStream
+ << "set(CMAKE_" << l->first << "_TARGET_INCLUDE_PATH\n";
+ std::vector<std::string> includes;
+
+ cmGeneratorTarget* gt = this->GetGlobalGenerator()
+ ->GetGeneratorTarget(&target);
+
+ const std::string& config =
+ this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE");
+ this->GetIncludeDirectories(includes, gt,
+ l->first, config);
+ for(std::vector<std::string>::iterator i = includes.begin();
+ i != includes.end(); ++i)
+ {
+ cmakefileStream
+ << " \""
+ << this->Convert(*i, cmLocalGenerator::HOME_OUTPUT)
+ << "\"\n";
+ }
+ cmakefileStream
+ << " )\n";
}
// Store include transform rule properties. Write the directory
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 57c49f1..c7a7110 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -1056,40 +1056,6 @@ 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;
-
- const std::string& config =
- this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE");
- this->LocalGenerator->GetIncludeDirectories(includes,
- this->GeneratorTarget,
- "C", config);
- for(std::vector<std::string>::iterator i = includes.begin();
- i != includes.end(); ++i)
- {
- *this->InfoFileStream
- << " \""
- << this->LocalGenerator->Convert(*i,
- 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;
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 87dcc99..7a6ad8b 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -1979,7 +1979,8 @@ static void processIncludeDirectories(cmTarget const* tgt,
std::vector<std::string> &includes,
UNORDERED_SET<std::string> &uniqueIncludes,
cmGeneratorExpressionDAGChecker *dagChecker,
- const std::string& config, bool debugIncludes)
+ const std::string& config, bool debugIncludes,
+ const std::string& language)
{
cmMakefile *mf = tgt->GetMakefile();
@@ -1995,7 +1996,7 @@ static void processIncludeDirectories(cmTarget const* tgt,
config,
false,
tgt,
- dagChecker),
+ dagChecker, language),
entryIncludes);
std::string usedIncludes;
@@ -2106,7 +2107,8 @@ static void processIncludeDirectories(cmTarget const* tgt,
//----------------------------------------------------------------------------
std::vector<std::string>
-cmTarget::GetIncludeDirectories(const std::string& config) const
+cmTarget::GetIncludeDirectories(const std::string& config,
+ const std::string& language) const
{
std::vector<std::string> includes;
UNORDERED_SET<std::string> uniqueIncludes;
@@ -2139,7 +2141,8 @@ cmTarget::GetIncludeDirectories(const std::string& config) const
uniqueIncludes,
&dagChecker,
config,
- debugIncludes);
+ debugIncludes,
+ language);
std::vector<cmTargetInternals::TargetPropertyEntry*>
linkInterfaceIncludeDirectoriesEntries;
@@ -2179,7 +2182,8 @@ cmTarget::GetIncludeDirectories(const std::string& config) const
uniqueIncludes,
&dagChecker,
config,
- debugIncludes);
+ debugIncludes,
+ language);
deleteAndClear(linkInterfaceIncludeDirectoriesEntries);
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 0356c1e..5170b31 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -568,7 +568,8 @@ public:
bool contentOnly) const;
std::vector<std::string> GetIncludeDirectories(
- const std::string& config) const;
+ const std::string& config,
+ const std::string& language) const;
void InsertInclude(const cmValueWithOrigin &entry,
bool before = false);
void InsertCompileOption(const cmValueWithOrigin &entry,