|
@@ -1911,19 +1911,56 @@ static void processIncludeDirectories(cmTarget *tgt,
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
std::string usedIncludes;
|
|
std::string usedIncludes;
|
|
|
|
|
+ cmListFileBacktrace lfbt;
|
|
|
for(std::vector<std::string>::iterator
|
|
for(std::vector<std::string>::iterator
|
|
|
li = entryIncludes.begin(); li != entryIncludes.end(); ++li)
|
|
li = entryIncludes.begin(); li != entryIncludes.end(); ++li)
|
|
|
{
|
|
{
|
|
|
- cmTarget *dependentTarget =
|
|
|
|
|
- mf->FindTargetToUse((*it)->TargetName.c_str());
|
|
|
|
|
|
|
+ std::string targetName = (*it)->TargetName;
|
|
|
|
|
+ std::string evaluatedTargetName;
|
|
|
|
|
+ {
|
|
|
|
|
+ cmGeneratorExpression ge(lfbt);
|
|
|
|
|
+ cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
|
|
|
|
|
+ ge.Parse(targetName);
|
|
|
|
|
+ evaluatedTargetName = cge->Evaluate(mf, config, false, tgt, 0, 0);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ cmTarget *dependentTarget = mf->FindTargetToUse(targetName.c_str());
|
|
|
|
|
|
|
|
const bool fromImported = dependentTarget
|
|
const bool fromImported = dependentTarget
|
|
|
&& dependentTarget->IsImported();
|
|
&& dependentTarget->IsImported();
|
|
|
|
|
|
|
|
- if (fromImported && !cmSystemTools::FileExists(li->c_str()))
|
|
|
|
|
|
|
+ cmTarget *evaluatedDependentTarget =
|
|
|
|
|
+ (targetName != evaluatedTargetName)
|
|
|
|
|
+ ? mf->FindTargetToUse(evaluatedTargetName.c_str())
|
|
|
|
|
+ : 0;
|
|
|
|
|
+
|
|
|
|
|
+ targetName = evaluatedTargetName;
|
|
|
|
|
+
|
|
|
|
|
+ const bool fromEvaluatedImported = evaluatedDependentTarget
|
|
|
|
|
+ && evaluatedDependentTarget->IsImported();
|
|
|
|
|
+
|
|
|
|
|
+ if ((fromImported || fromEvaluatedImported)
|
|
|
|
|
+ && !cmSystemTools::FileExists(li->c_str()))
|
|
|
{
|
|
{
|
|
|
cmOStringStream e;
|
|
cmOStringStream e;
|
|
|
- e << "Imported target \"" << (*it)->TargetName << "\" includes "
|
|
|
|
|
|
|
+ cmake::MessageType messageType = cmake::FATAL_ERROR;
|
|
|
|
|
+ if (fromEvaluatedImported)
|
|
|
|
|
+ {
|
|
|
|
|
+ switch(mf->GetPolicyStatus(cmPolicies::CMP0027))
|
|
|
|
|
+ {
|
|
|
|
|
+ case cmPolicies::WARN:
|
|
|
|
|
+ e << (mf->GetPolicies()
|
|
|
|
|
+ ->GetPolicyWarning(cmPolicies::CMP0027)) << "\n";
|
|
|
|
|
+ case cmPolicies::OLD:
|
|
|
|
|
+ messageType = cmake::AUTHOR_WARNING;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case cmPolicies::REQUIRED_ALWAYS:
|
|
|
|
|
+ case cmPolicies::REQUIRED_IF_USED:
|
|
|
|
|
+ case cmPolicies::NEW:
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ e << "Imported target \"" << targetName << "\" includes "
|
|
|
"non-existent path\n \"" << *li << "\"\nin its "
|
|
"non-existent path\n \"" << *li << "\"\nin its "
|
|
|
"INTERFACE_INCLUDE_DIRECTORIES. Possible reasons include:\n"
|
|
"INTERFACE_INCLUDE_DIRECTORIES. Possible reasons include:\n"
|
|
|
"* The path was deleted, renamed, or moved to another "
|
|
"* The path was deleted, renamed, or moved to another "
|
|
@@ -1932,7 +1969,7 @@ static void processIncludeDirectories(cmTarget *tgt,
|
|
|
"successfully.\n"
|
|
"successfully.\n"
|
|
|
"* The installation package was faulty and references files it "
|
|
"* The installation package was faulty and references files it "
|
|
|
"does not provide.\n";
|
|
"does not provide.\n";
|
|
|
- tgt->GetMakefile()->IssueMessage(cmake::FATAL_ERROR, e.str().c_str());
|
|
|
|
|
|
|
+ tgt->GetMakefile()->IssueMessage(messageType, e.str().c_str());
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1941,9 +1978,9 @@ static void processIncludeDirectories(cmTarget *tgt,
|
|
|
cmOStringStream e;
|
|
cmOStringStream e;
|
|
|
bool noMessage = false;
|
|
bool noMessage = false;
|
|
|
cmake::MessageType messageType = cmake::FATAL_ERROR;
|
|
cmake::MessageType messageType = cmake::FATAL_ERROR;
|
|
|
- if (!(*it)->TargetName.empty())
|
|
|
|
|
|
|
+ if (!targetName.empty())
|
|
|
{
|
|
{
|
|
|
- e << "Target \"" << (*it)->TargetName << "\" contains relative "
|
|
|
|
|
|
|
+ e << "Target \"" << targetName << "\" contains relative "
|
|
|
"path in its INTERFACE_INCLUDE_DIRECTORIES:\n"
|
|
"path in its INTERFACE_INCLUDE_DIRECTORIES:\n"
|
|
|
" \"" << *li << "\"";
|
|
" \"" << *li << "\"";
|
|
|
}
|
|
}
|