summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/include_directories
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2013-11-25 14:54:54 (GMT)
committerStephen Kelly <steveire@gmail.com>2013-11-26 12:00:43 (GMT)
commit80790f33114cb6d80dfa0fd139cb2d92608cc68c (patch)
tree13b30dd9739b9e4d0e24fae27e4e1afc2791dcdf /Tests/RunCMake/include_directories
parent38afc82e764ed9071748df9f5386c53f26657fe5 (diff)
downloadCMake-80790f33114cb6d80dfa0fd139cb2d92608cc68c.zip
CMake-80790f33114cb6d80dfa0fd139cb2d92608cc68c.tar.gz
CMake-80790f33114cb6d80dfa0fd139cb2d92608cc68c.tar.bz2
Export: Test existing behavior of exporting includes with genexes.
Test that no warning or error diagnostic is issued for 'good code'.
Diffstat (limited to 'Tests/RunCMake/include_directories')
-rw-r--r--Tests/RunCMake/include_directories/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/include_directories/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/include_directories/export-NOWARN-result.txt1
-rw-r--r--Tests/RunCMake/include_directories/export-NOWARN-stderr.txt1
-rw-r--r--Tests/RunCMake/include_directories/export-NOWARN.cmake50
5 files changed, 54 insertions, 1 deletions
diff --git a/Tests/RunCMake/include_directories/CMakeLists.txt b/Tests/RunCMake/include_directories/CMakeLists.txt
index 12cd3c7..f452db1 100644
--- a/Tests/RunCMake/include_directories/CMakeLists.txt
+++ b/Tests/RunCMake/include_directories/CMakeLists.txt
@@ -1,3 +1,3 @@
cmake_minimum_required(VERSION 2.8.4)
-project(${RunCMake_TEST} NONE)
+project(${RunCMake_TEST} CXX)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/include_directories/RunCMakeTest.cmake b/Tests/RunCMake/include_directories/RunCMakeTest.cmake
index f66823e..c00b924 100644
--- a/Tests/RunCMake/include_directories/RunCMakeTest.cmake
+++ b/Tests/RunCMake/include_directories/RunCMakeTest.cmake
@@ -11,3 +11,4 @@ run_cmake(RelativePathInGenex)
run_cmake(CMP0021)
run_cmake(install_config)
run_cmake(incomplete-genex)
+run_cmake(export-NOWARN)
diff --git a/Tests/RunCMake/include_directories/export-NOWARN-result.txt b/Tests/RunCMake/include_directories/export-NOWARN-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/include_directories/export-NOWARN-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/include_directories/export-NOWARN-stderr.txt b/Tests/RunCMake/include_directories/export-NOWARN-stderr.txt
new file mode 100644
index 0000000..10f3293
--- /dev/null
+++ b/Tests/RunCMake/include_directories/export-NOWARN-stderr.txt
@@ -0,0 +1 @@
+^$
diff --git a/Tests/RunCMake/include_directories/export-NOWARN.cmake b/Tests/RunCMake/include_directories/export-NOWARN.cmake
new file mode 100644
index 0000000..924511d
--- /dev/null
+++ b/Tests/RunCMake/include_directories/export-NOWARN.cmake
@@ -0,0 +1,50 @@
+
+add_library(foo empty.cpp)
+set_property(TARGET foo APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $<0:>/include/subdir)
+set_property(TARGET foo APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $<INSTALL_PREFIX>/include/subdir)
+
+set_property(TARGET foo APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include/subdir>)
+set_property(TARGET foo APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $<INSTALL_INTERFACE:include/subdir>)
+set_property(TARGET foo APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $<INSTALL_INTERFACE:include/$<0:>>)
+set_property(TARGET foo APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $<INSTALL_INTERFACE:$<0:>/include>)
+
+# target_include_directories(foo INTERFACE include/subdir) # Does and should warn. INSTALL_INTERFACE must not list src dir paths.
+target_include_directories(foo INTERFACE $<0:>/include/subdir) # Does not and should not should warn, because it starts with a genex.
+target_include_directories(foo INTERFACE $<INSTALL_PREFIX>/include/subdir)
+
+target_include_directories(foo INTERFACE $<INSTALL_INTERFACE:include/subdir>)
+target_include_directories(foo INTERFACE $<INSTALL_INTERFACE:include/$<0:>>)
+
+install(TARGETS foo EXPORT FooTargets DESTINATION lib)
+install(EXPORT FooTargets DESTINATION lib/cmake)
+
+install(TARGETS foo EXPORT FooTargets2
+ DESTINATION lib
+ INCLUDES DESTINATION include # No warning. Implicit install prefix.
+)
+install(EXPORT FooTargets2 DESTINATION lib/cmake)
+
+install(TARGETS foo EXPORT FooTargets3
+ DESTINATION lib
+ INCLUDES DESTINATION $<INSTALL_PREFIX>include
+)
+install(EXPORT FooTargets3 DESTINATION lib/cmake)
+
+install(TARGETS foo EXPORT FooTargets4
+ DESTINATION lib
+ INCLUDES DESTINATION $<INSTALL_INTERFACE:include>
+)
+install(EXPORT FooTargets4 DESTINATION lib/cmake)
+
+install(TARGETS foo EXPORT FooTargets5
+ DESTINATION lib
+ # The $<0:> is evaluated at export time, leaving 'include' behind, which should be treated as above.
+ INCLUDES DESTINATION $<INSTALL_INTERFACE:$<0:>include>
+)
+install(EXPORT FooTargets5 DESTINATION lib/cmake)
+
+install(TARGETS foo EXPORT FooTargets6
+ DESTINATION lib
+ INCLUDES DESTINATION $<INSTALL_INTERFACE:include$<0:>>
+)
+install(EXPORT FooTargets6 DESTINATION lib/cmake)