summaryrefslogtreecommitdiffstats
path: root/Source/cmTarget.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2013-03-26 17:08:26 (GMT)
committerStephen Kelly <steveire@gmail.com>2013-03-26 18:56:10 (GMT)
commit634bb33f3aa3b7f2181a896c025976b52171524a (patch)
tree5d5d5373f683b378b16b3f5709feefe7bb0993e4 /Source/cmTarget.cxx
parent28051f1150923804796b4e63e41f6906308788e0 (diff)
downloadCMake-634bb33f3aa3b7f2181a896c025976b52171524a.zip
CMake-634bb33f3aa3b7f2181a896c025976b52171524a.tar.gz
CMake-634bb33f3aa3b7f2181a896c025976b52171524a.tar.bz2
Error if linked target has relative paths in INTERFACE_INCLUDE_DIRECTORIES
We can do this check only if the TargetName is non-empty, which means that we're evaluating INTERFACE_INCLUDE_DIRECTORIES from a linked dependency which was set using target_link_libraries. It is possible to have relative paths in INCLUDE_DIRECTORIES already in CMake 2.8.10.2, so that part will require a policy to fix.
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r--Source/cmTarget.cxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index b4fdcd5..1b329cf 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -2842,6 +2842,20 @@ static void processIncludeDirectories(cmTarget *tgt,
return;
}
+ if (!cmSystemTools::FileIsFullPath(li->c_str()))
+ {
+ if (!(*it)->TargetName.empty())
+ {
+ cmOStringStream e;
+ e << "Target \"" << (*it)->TargetName << "\" contains relative "
+ "path in its INTERFACE_INCLUDE_DIRECTORIES:\n"
+ " \"" << *li << "\" ";
+ tgt->GetMakefile()->IssueMessage(cmake::FATAL_ERROR,
+ e.str().c_str());
+ return;
+ }
+ }
+
if (testIsOff && !cmSystemTools::IsOff(li->c_str()))
{
cmSystemTools::ConvertToUnixSlashes(*li);