diff options
author | Stephen Kelly <steveire@gmail.com> | 2013-03-26 18:08:29 +0100 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-05-21 14:59:17 -0400 |
commit | eabefa8b02b399b00aea83185b6b364ab5b6aa3d (patch) | |
tree | d704dd000578415ab3be7b88248488d4d06caf73 /Tests/RunCMake/include_directories | |
parent | 272431a84ff13eb17cf04389428f57c7fe13e3a2 (diff) | |
download | cmake-eabefa8b02b399b00aea83185b6b364ab5b6aa3d.tar.gz |
Error on relative path in INCLUDE_DIRECTORIES target property.
Add policy CMP0021 to preserve existing behavior in projects expecting
it from earlier CMake versions.
Diffstat (limited to 'Tests/RunCMake/include_directories')
4 files changed, 15 insertions, 0 deletions
diff --git a/Tests/RunCMake/include_directories/CMP0021-result.txt b/Tests/RunCMake/include_directories/CMP0021-result.txt new file mode 100644 index 0000000000..d00491fd7e --- /dev/null +++ b/Tests/RunCMake/include_directories/CMP0021-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/include_directories/CMP0021-stderr.txt b/Tests/RunCMake/include_directories/CMP0021-stderr.txt new file mode 100644 index 0000000000..c0781e7cf6 --- /dev/null +++ b/Tests/RunCMake/include_directories/CMP0021-stderr.txt @@ -0,0 +1,4 @@ +CMake Error in CMakeLists.txt: + Found relative path while evaluating include directories of "userTarget": + + "foo" diff --git a/Tests/RunCMake/include_directories/CMP0021.cmake b/Tests/RunCMake/include_directories/CMP0021.cmake new file mode 100644 index 0000000000..f18666b076 --- /dev/null +++ b/Tests/RunCMake/include_directories/CMP0021.cmake @@ -0,0 +1,9 @@ +enable_language(CXX) + +cmake_policy(SET CMP0021 NEW) + +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_include_directories(userTarget PRIVATE $<TARGET_PROPERTY:testTarget,INTERFACE_INCLUDE_DIRECTORIES>) diff --git a/Tests/RunCMake/include_directories/RunCMakeTest.cmake b/Tests/RunCMake/include_directories/RunCMakeTest.cmake index f5160860dc..520dd448d0 100644 --- a/Tests/RunCMake/include_directories/RunCMakeTest.cmake +++ b/Tests/RunCMake/include_directories/RunCMakeTest.cmake @@ -8,3 +8,4 @@ run_cmake(BinaryDirectoryInInterface) run_cmake(RelativePathInInterface) run_cmake(ImportedTarget) run_cmake(RelativePathInGenex) +run_cmake(CMP0021) |