summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/IfacePaths/export-NOWARN.cmake
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2014-11-30 12:20:32 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-02-09 18:23:47 (GMT)
commitcc1520947608f5224a4fdfa94b5cb07e19e23600 (patch)
tree747fd80f92718d130a12ed8b1309ac4b3fc3f637 /Tests/RunCMake/IfacePaths/export-NOWARN.cmake
parentc0d8e715915f65196353c09d86d4d34fe100437f (diff)
downloadCMake-cc1520947608f5224a4fdfa94b5cb07e19e23600.zip
CMake-cc1520947608f5224a4fdfa94b5cb07e19e23600.tar.gz
CMake-cc1520947608f5224a4fdfa94b5cb07e19e23600.tar.bz2
Tests: Split part of include_directories test to a generic location.
The moved tests are related to paths in INTERFACE_INCLUDE_DIRECTORIES in general, and when exporting, and covering cases of the install location being within the build or source prefix etc. Other build properties containing paths should have similar tests, so this allows some parameterization while keeping the preparation of the various directory structures.
Diffstat (limited to 'Tests/RunCMake/IfacePaths/export-NOWARN.cmake')
-rw-r--r--Tests/RunCMake/IfacePaths/export-NOWARN.cmake62
1 files changed, 62 insertions, 0 deletions
diff --git a/Tests/RunCMake/IfacePaths/export-NOWARN.cmake b/Tests/RunCMake/IfacePaths/export-NOWARN.cmake
new file mode 100644
index 0000000..50720a0
--- /dev/null
+++ b/Tests/RunCMake/IfacePaths/export-NOWARN.cmake
@@ -0,0 +1,62 @@
+enable_language(CXX)
+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)
+
+install(TARGETS foo EXPORT FooTargets7
+ DESTINATION lib
+ INCLUDES DESTINATION include$<0:>
+)
+install(EXPORT FooTargets7 DESTINATION lib/cmake)
+
+install(TARGETS foo EXPORT FooTargets8
+ DESTINATION lib
+ INCLUDES DESTINATION $<0:>include
+)
+install(EXPORT FooTargets8 DESTINATION lib/cmake)