summaryrefslogtreecommitdiffstats
path: root/Source/cmTarget.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-03-26 18:36:45 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2013-03-26 18:36:45 (GMT)
commitb9e4a5abb45055b310032977a9542acff3c14c9b (patch)
tree21d1ca377f1c2274635647b0a8092bebb602ba07 /Source/cmTarget.cxx
parent169bba41f29169126673b801c8b535a62b0f634d (diff)
parent28051f1150923804796b4e63e41f6906308788e0 (diff)
downloadCMake-b9e4a5abb45055b310032977a9542acff3c14c9b.zip
CMake-b9e4a5abb45055b310032977a9542acff3c14c9b.tar.gz
CMake-b9e4a5abb45055b310032977a9542acff3c14c9b.tar.bz2
Merge topic 'error-on-exported-missing-include-dir'
28051f1 Report an error on IMPORTED targets with a faulty INTERFACE af81a3c install(EXPORT): Ensure clean INTERFACE_INCLUDE_DIRECTORIES
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r--Source/cmTarget.cxx31
1 files changed, 28 insertions, 3 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 53e3cfa..52a2732 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -131,11 +131,13 @@ public:
SourceEntriesType SourceEntries;
struct IncludeDirectoriesEntry {
- IncludeDirectoriesEntry(cmsys::auto_ptr<cmCompiledGeneratorExpression> cge)
- : ge(cge)
+ IncludeDirectoriesEntry(cmsys::auto_ptr<cmCompiledGeneratorExpression> cge,
+ const std::string &targetName = std::string())
+ : ge(cge), TargetName(targetName)
{}
const cmsys::auto_ptr<cmCompiledGeneratorExpression> ge;
std::vector<std::string> CachedIncludes;
+ const std::string TargetName;
};
std::vector<IncludeDirectoriesEntry*> IncludeDirectoriesEntries;
std::vector<cmValueWithOrigin> LinkInterfaceIncludeDirectoriesEntries;
@@ -2818,6 +2820,28 @@ static void processIncludeDirectories(cmTarget *tgt,
for(std::vector<std::string>::iterator
li = entryIncludes.begin(); li != entryIncludes.end(); ++li)
{
+ cmTarget *dependentTarget =
+ mf->FindTargetToUse((*it)->TargetName.c_str());
+
+ const bool fromImported = dependentTarget
+ && dependentTarget->IsImported();
+
+ if (fromImported && !cmSystemTools::FileExists(li->c_str()))
+ {
+ cmOStringStream e;
+ e << "Imported target \"" << (*it)->TargetName << "\" includes "
+ "non-existent path\n \"" << *li << "\"\nin its "
+ "INTERFACE_INCLUDE_DIRECTORIES. Possible reasons include:\n"
+ "* The path was deleted, renamed, or moved to another "
+ "location.\n"
+ "* An install or uninstall procedure did not complete "
+ "successfully.\n"
+ "* The installation package was faulty and references files it "
+ "does not provide.\n";
+ tgt->GetMakefile()->IssueMessage(cmake::FATAL_ERROR, e.str().c_str());
+ return;
+ }
+
if (testIsOff && !cmSystemTools::IsOff(li->c_str()))
{
cmSystemTools::ConvertToUnixSlashes(*li);
@@ -2913,7 +2937,8 @@ std::vector<std::string> cmTarget::GetIncludeDirectories(const char *config)
it->Value + ",INTERFACE_INCLUDE_DIRECTORIES>");
this->Internal->CachedLinkInterfaceIncludeDirectoriesEntries.push_back(
- new cmTargetInternals::IncludeDirectoriesEntry(cge));
+ new cmTargetInternals::IncludeDirectoriesEntry(cge,
+ it->Value));
}
}