[Cmake-commits] CMake branch, next, updated. v2.8.10.2-2670-g46ec65d
Stephen Kelly
steveire at gmail.com
Tue Mar 26 14:57:18 EDT 2013
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 46ec65d78df4b0baff5aca2d7a98b1205965c778 (commit)
via 634bb33f3aa3b7f2181a896c025976b52171524a (commit)
from 6f654af66540007909070cea353694bc86d34079 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=46ec65d78df4b0baff5aca2d7a98b1205965c778
commit 46ec65d78df4b0baff5aca2d7a98b1205965c778
Merge: 6f654af 634bb33
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Mar 26 14:57:15 2013 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Mar 26 14:57:15 2013 -0400
Merge topic 'error-on-exported-missing-include-dir' into next
634bb33 Error if linked target has relative paths in INTERFACE_INCLUDE_DIRECTORIES
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=634bb33f3aa3b7f2181a896c025976b52171524a
commit 634bb33f3aa3b7f2181a896c025976b52171524a
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Mar 26 18:08:26 2013 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Mar 26 19:56:10 2013 +0100
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.
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);
diff --git a/Tests/RunCMake/include_directories/RelativePathInGenex-result.txt b/Tests/RunCMake/include_directories/RelativePathInGenex-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/include_directories/RelativePathInGenex-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/include_directories/RelativePathInGenex-stderr.txt b/Tests/RunCMake/include_directories/RelativePathInGenex-stderr.txt
new file mode 100644
index 0000000..490c700
--- /dev/null
+++ b/Tests/RunCMake/include_directories/RelativePathInGenex-stderr.txt
@@ -0,0 +1,5 @@
+CMake Error in CMakeLists.txt:
+ Target "testTarget" contains relative path in its
+ INTERFACE_INCLUDE_DIRECTORIES:
+
+ "foo"
diff --git a/Tests/RunCMake/include_directories/RelativePathInGenex.cmake b/Tests/RunCMake/include_directories/RelativePathInGenex.cmake
new file mode 100644
index 0000000..f72cf3a
--- /dev/null
+++ b/Tests/RunCMake/include_directories/RelativePathInGenex.cmake
@@ -0,0 +1,8 @@
+
+project(RelativePathInInterface)
+
+add_library(testTarget "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp")
+set_property(TARGET testTarget PROPERTY INTERFACE_INCLUDE_DIRECTORIES "$<1:foo>")
+
+add_library(userTarget "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp")
+target_link_libraries(userTarget testTarget)
diff --git a/Tests/RunCMake/include_directories/RunCMakeTest.cmake b/Tests/RunCMake/include_directories/RunCMakeTest.cmake
index 1caae5c..f516086 100644
--- a/Tests/RunCMake/include_directories/RunCMakeTest.cmake
+++ b/Tests/RunCMake/include_directories/RunCMakeTest.cmake
@@ -7,3 +7,4 @@ run_cmake(SourceDirectoryInInterface)
run_cmake(BinaryDirectoryInInterface)
run_cmake(RelativePathInInterface)
run_cmake(ImportedTarget)
+run_cmake(RelativePathInGenex)
-----------------------------------------------------------------------
Summary of changes:
Source/cmTarget.cxx | 14 ++++++++++++++
.../RelativePathInGenex-result.txt} | 0
.../RelativePathInGenex-stderr.txt | 5 +++++
...InInterface.cmake => RelativePathInGenex.cmake} | 9 +++------
.../include_directories/RunCMakeTest.cmake | 1 +
5 files changed, 23 insertions(+), 6 deletions(-)
copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => include_directories/RelativePathInGenex-result.txt} (100%)
create mode 100644 Tests/RunCMake/include_directories/RelativePathInGenex-stderr.txt
copy Tests/RunCMake/include_directories/{RelativePathInInterface.cmake => RelativePathInGenex.cmake} (55%)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list