summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/include_directories
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2013-03-24 20:18:17 (GMT)
committerBrad King <brad.king@kitware.com>2013-03-26 14:45:07 (GMT)
commitaf81a3c31b206633742eb13d41c54a9bc807ffea (patch)
treeb309b37bc371f153819eeffb909b586eb89b74dc /Tests/RunCMake/include_directories
parentddbe2e1d7da460684e4d81fc8b3f69510f87b78e (diff)
downloadCMake-af81a3c31b206633742eb13d41c54a9bc807ffea.zip
CMake-af81a3c31b206633742eb13d41c54a9bc807ffea.tar.gz
CMake-af81a3c31b206633742eb13d41c54a9bc807ffea.tar.bz2
install(EXPORT): Ensure clean INTERFACE_INCLUDE_DIRECTORIES
Check that source and binary directories are not part of the INTERFACE_INCLUDE_DIRECTORIES for installed IMPORTED targets. This is limited to directories which do not contain generator expressions to evaluate. Such paths can only be checked at time of use of the imported target, which will be done in a follow up patch.
Diffstat (limited to 'Tests/RunCMake/include_directories')
-rw-r--r--Tests/RunCMake/include_directories/BinaryDirectoryInInterface-result.txt1
-rw-r--r--Tests/RunCMake/include_directories/BinaryDirectoryInInterface-stderr.txt6
-rw-r--r--Tests/RunCMake/include_directories/BinaryDirectoryInInterface.cmake11
-rw-r--r--Tests/RunCMake/include_directories/RelativePathInInterface-result.txt1
-rw-r--r--Tests/RunCMake/include_directories/RelativePathInInterface-stderr.txt5
-rw-r--r--Tests/RunCMake/include_directories/RelativePathInInterface.cmake11
-rw-r--r--Tests/RunCMake/include_directories/RunCMakeTest.cmake3
-rw-r--r--Tests/RunCMake/include_directories/SourceDirectoryInInterface-result.txt1
-rw-r--r--Tests/RunCMake/include_directories/SourceDirectoryInInterface-stderr.txt6
-rw-r--r--Tests/RunCMake/include_directories/SourceDirectoryInInterface.cmake11
-rw-r--r--Tests/RunCMake/include_directories/empty.cpp0
11 files changed, 56 insertions, 0 deletions
diff --git a/Tests/RunCMake/include_directories/BinaryDirectoryInInterface-result.txt b/Tests/RunCMake/include_directories/BinaryDirectoryInInterface-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/include_directories/BinaryDirectoryInInterface-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/include_directories/BinaryDirectoryInInterface-stderr.txt b/Tests/RunCMake/include_directories/BinaryDirectoryInInterface-stderr.txt
new file mode 100644
index 0000000..0d4379e
--- /dev/null
+++ b/Tests/RunCMake/include_directories/BinaryDirectoryInInterface-stderr.txt
@@ -0,0 +1,6 @@
+CMake Error in CMakeLists.txt:
+ Target "testTarget" INTERFACE_INCLUDE_DIRECTORIES property contains path:
+
+ ".*RunCMake/include_directories/BinaryDirectoryInInterface-build/foo"
+
+ which is prefixed in the build directory.
diff --git a/Tests/RunCMake/include_directories/BinaryDirectoryInInterface.cmake b/Tests/RunCMake/include_directories/BinaryDirectoryInInterface.cmake
new file mode 100644
index 0000000..8754540
--- /dev/null
+++ b/Tests/RunCMake/include_directories/BinaryDirectoryInInterface.cmake
@@ -0,0 +1,11 @@
+
+project(BinaryDirectoryInInterface)
+
+add_library(testTarget "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp")
+target_include_directories(testTarget INTERFACE "${CMAKE_CURRENT_BINARY_DIR}/foo")
+
+install(TARGETS testTarget EXPORT testTargets
+ DESTINATION lib
+)
+
+install(EXPORT testTargets DESTINATION lib/cmake)
diff --git a/Tests/RunCMake/include_directories/RelativePathInInterface-result.txt b/Tests/RunCMake/include_directories/RelativePathInInterface-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/include_directories/RelativePathInInterface-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/include_directories/RelativePathInInterface-stderr.txt b/Tests/RunCMake/include_directories/RelativePathInInterface-stderr.txt
new file mode 100644
index 0000000..f6cdb53
--- /dev/null
+++ b/Tests/RunCMake/include_directories/RelativePathInInterface-stderr.txt
@@ -0,0 +1,5 @@
+CMake Error in CMakeLists.txt:
+ Target "testTarget" INTERFACE_INCLUDE_DIRECTORIES property contains
+ relative path:
+
+ "foo"
diff --git a/Tests/RunCMake/include_directories/RelativePathInInterface.cmake b/Tests/RunCMake/include_directories/RelativePathInInterface.cmake
new file mode 100644
index 0000000..f2ce54a
--- /dev/null
+++ b/Tests/RunCMake/include_directories/RelativePathInInterface.cmake
@@ -0,0 +1,11 @@
+
+project(RelativePathInInterface)
+
+add_library(testTarget "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp")
+set_property(TARGET testTarget PROPERTY INTERFACE_INCLUDE_DIRECTORIES "foo")
+
+install(TARGETS testTarget EXPORT testTargets
+ DESTINATION lib
+)
+
+install(EXPORT testTargets DESTINATION lib/cmake)
diff --git a/Tests/RunCMake/include_directories/RunCMakeTest.cmake b/Tests/RunCMake/include_directories/RunCMakeTest.cmake
index ddf268c..bd299fc 100644
--- a/Tests/RunCMake/include_directories/RunCMakeTest.cmake
+++ b/Tests/RunCMake/include_directories/RunCMakeTest.cmake
@@ -3,3 +3,6 @@ include(RunCMake)
run_cmake(NotFoundContent)
run_cmake(DebugIncludes)
run_cmake(TID-bad-target)
+run_cmake(SourceDirectoryInInterface)
+run_cmake(BinaryDirectoryInInterface)
+run_cmake(RelativePathInInterface)
diff --git a/Tests/RunCMake/include_directories/SourceDirectoryInInterface-result.txt b/Tests/RunCMake/include_directories/SourceDirectoryInInterface-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/include_directories/SourceDirectoryInInterface-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/include_directories/SourceDirectoryInInterface-stderr.txt b/Tests/RunCMake/include_directories/SourceDirectoryInInterface-stderr.txt
new file mode 100644
index 0000000..9346b99
--- /dev/null
+++ b/Tests/RunCMake/include_directories/SourceDirectoryInInterface-stderr.txt
@@ -0,0 +1,6 @@
+CMake Error in CMakeLists.txt:
+ Target "testTarget" INTERFACE_INCLUDE_DIRECTORIES property contains path:
+
+ ".*RunCMake/include_directories/foo"
+
+ which is prefixed in the source directory.
diff --git a/Tests/RunCMake/include_directories/SourceDirectoryInInterface.cmake b/Tests/RunCMake/include_directories/SourceDirectoryInInterface.cmake
new file mode 100644
index 0000000..c9a9c45
--- /dev/null
+++ b/Tests/RunCMake/include_directories/SourceDirectoryInInterface.cmake
@@ -0,0 +1,11 @@
+
+project(SourceDirectoryInInterface)
+
+add_library(testTarget "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp")
+target_include_directories(testTarget INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/foo")
+
+install(TARGETS testTarget EXPORT testTargets
+ DESTINATION lib
+)
+
+install(EXPORT testTargets DESTINATION lib/cmake)
diff --git a/Tests/RunCMake/include_directories/empty.cpp b/Tests/RunCMake/include_directories/empty.cpp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/include_directories/empty.cpp