summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-04-12 14:20:09 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-04-12 14:20:20 (GMT)
commit4adc0b7c758ed98776bec63d21bb2037b0f28e2d (patch)
tree9bd43553c8d780641c16f5f285f90f8bf9c5130c /Tests
parentdb6fdfdb053a372382ff8eadad9bfa47c1a3b4bc (diff)
parenta40f9083dd17d1cccf89ccdf290c3f494cab3aac (diff)
downloadCMake-4adc0b7c758ed98776bec63d21bb2037b0f28e2d.zip
CMake-4adc0b7c758ed98776bec63d21bb2037b0f28e2d.tar.gz
CMake-4adc0b7c758ed98776bec63d21bb2037b0f28e2d.tar.bz2
Merge topic 'iface-headers'
a40f9083dd INTERFACE Target: allow (PUBLIC/PRIVATE)_HEADER properties Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3181
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/install/TARGETS-Defaults-all-check.cmake6
-rw-r--r--Tests/RunCMake/install/TARGETS-Defaults.cmake8
-rw-r--r--Tests/RunCMake/install/obj2.h6
-rw-r--r--Tests/RunCMake/interface_library/whitelist.cmake9
4 files changed, 29 insertions, 0 deletions
diff --git a/Tests/RunCMake/install/TARGETS-Defaults-all-check.cmake b/Tests/RunCMake/install/TARGETS-Defaults-all-check.cmake
index c41cb2a..15335b2 100644
--- a/Tests/RunCMake/install/TARGETS-Defaults-all-check.cmake
+++ b/Tests/RunCMake/install/TARGETS-Defaults-all-check.cmake
@@ -4,6 +4,8 @@ if(WIN32)
[[bin/exe\.exe]]
[[bin/(lib)?lib1\.dll]]
[[include]]
+ [[include/obj1\.h]]
+ [[include/obj2\.h]]
[[include/obj4\.h]]
[[include/obj5\.h]]
[[lib]]
@@ -20,6 +22,8 @@ elseif(CYGWIN)
[[bin/cyglib1\.dll]]
[[bin/exe\.exe]]
[[include]]
+ [[include/obj1\.h]]
+ [[include/obj2\.h]]
[[include/obj4\.h]]
[[include/obj5\.h]]
[[lib]]
@@ -35,6 +39,8 @@ else()
[[bin]]
[[bin/exe]]
[[include]]
+ [[include/obj1\.h]]
+ [[include/obj2\.h]]
[[include/obj4\.h]]
[[include/obj5\.h]]
[[lib]]
diff --git a/Tests/RunCMake/install/TARGETS-Defaults.cmake b/Tests/RunCMake/install/TARGETS-Defaults.cmake
index bfd8c2c..324aa11 100644
--- a/Tests/RunCMake/install/TARGETS-Defaults.cmake
+++ b/Tests/RunCMake/install/TARGETS-Defaults.cmake
@@ -8,6 +8,11 @@ set_property(TARGET lib3 PROPERTY PRIVATE_HEADER ${CMAKE_CURRENT_SOURCE_DIR}/obj
add_library(lib4 SHARED obj5.c)
set_property(TARGET lib4 PROPERTY PUBLIC_HEADER ${CMAKE_CURRENT_SOURCE_DIR}/obj5.h)
+add_library(iface INTERFACE)
+set_target_properties(iface PROPERTIES
+ PUBLIC_HEADER ${CMAKE_CURRENT_SOURCE_DIR}/obj1.h
+ PRIVATE_HEADER ${CMAKE_CURRENT_SOURCE_DIR}/obj2.h)
+
install(TARGETS exe lib1 lib2)
install(TARGETS lib3
LIBRARY DESTINATION lib3
@@ -17,3 +22,6 @@ install(TARGETS lib4
LIBRARY DESTINATION lib4
RUNTIME DESTINATION lib4
)
+install(TARGETS iface
+ PUBLIC_HEADER DESTINATION include
+ PRIVATE_HEADER DESTINATION include)
diff --git a/Tests/RunCMake/install/obj2.h b/Tests/RunCMake/install/obj2.h
new file mode 100644
index 0000000..90bcd34
--- /dev/null
+++ b/Tests/RunCMake/install/obj2.h
@@ -0,0 +1,6 @@
+#ifndef OBJ2_H
+#define OBJ2_H
+
+int obj2(void);
+
+#endif /* OBJ2_H */
diff --git a/Tests/RunCMake/interface_library/whitelist.cmake b/Tests/RunCMake/interface_library/whitelist.cmake
index bf64f01..0db6375 100644
--- a/Tests/RunCMake/interface_library/whitelist.cmake
+++ b/Tests/RunCMake/interface_library/whitelist.cmake
@@ -14,3 +14,12 @@ get_target_property(outname iface "_custom_property")
set_property(TARGET iface PROPERTY "custom_property" output)
set_property(TARGET iface APPEND PROPERTY "custom_property" append)
get_target_property(outname iface "custom_property")
+
+# PUBLIC_HEADER / PRIVATE_HEADER properties are allowed
+set_property(TARGET iface PROPERTY PUBLIC_HEADER foo.h)
+set_property(TARGET iface APPEND PROPERTY PUBLIC_HEADER bar.h)
+get_target_property(outname iface PUBLIC_HEADER)
+
+set_property(TARGET iface PROPERTY PRIVATE_HEADER foo.h)
+set_property(TARGET iface APPEND PROPERTY PRIVATE_HEADER bar.h)
+get_target_property(outname iface PRIVATE_HEADER)