diff options
author | Stephen Kelly <steveire@gmail.com> | 2013-03-26 17:08:26 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2013-03-26 18:56:10 (GMT) |
commit | 634bb33f3aa3b7f2181a896c025976b52171524a (patch) | |
tree | 5d5d5373f683b378b16b3f5709feefe7bb0993e4 /Tests | |
parent | 28051f1150923804796b4e63e41f6906308788e0 (diff) | |
download | CMake-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 'Tests')
4 files changed, 15 insertions, 0 deletions
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) |