summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/include_directories
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2013-03-26 17:08:29 (GMT)
committerBrad King <brad.king@kitware.com>2013-05-21 18:59:17 (GMT)
commiteabefa8b02b399b00aea83185b6b364ab5b6aa3d (patch)
treed704dd000578415ab3be7b88248488d4d06caf73 /Tests/RunCMake/include_directories
parent272431a84ff13eb17cf04389428f57c7fe13e3a2 (diff)
downloadCMake-eabefa8b02b399b00aea83185b6b364ab5b6aa3d.zip
CMake-eabefa8b02b399b00aea83185b6b364ab5b6aa3d.tar.gz
CMake-eabefa8b02b399b00aea83185b6b364ab5b6aa3d.tar.bz2
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')
-rw-r--r--Tests/RunCMake/include_directories/CMP0021-result.txt1
-rw-r--r--Tests/RunCMake/include_directories/CMP0021-stderr.txt4
-rw-r--r--Tests/RunCMake/include_directories/CMP0021.cmake9
-rw-r--r--Tests/RunCMake/include_directories/RunCMakeTest.cmake1
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 0000000..d00491f
--- /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 0000000..c0781e7
--- /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 0000000..f18666b
--- /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 f516086..520dd44 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)