summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2018-07-12 14:41:04 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2018-07-17 13:07:01 (GMT)
commitb5df4faa203bfac4bee9924520015f76f9692676 (patch)
treea461487c229bd10e496a7ef07ba142cd45faf778 /Tests
parent4108ab4be2307ef161467de46e4c35e8b086ce02 (diff)
downloadCMake-b5df4faa203bfac4bee9924520015f76f9692676.zip
CMake-b5df4faa203bfac4bee9924520015f76f9692676.tar.gz
CMake-b5df4faa203bfac4bee9924520015f76f9692676.tar.bz2
Tests: Add test for installing parts of targets in different directories
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/install/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/install/TARGETS-Parts-all-check.cmake1
-rw-r--r--Tests/RunCMake/install/TARGETS-Parts.cmake7
-rw-r--r--Tests/RunCMake/install/obj1.h6
4 files changed, 15 insertions, 0 deletions
diff --git a/Tests/RunCMake/install/RunCMakeTest.cmake b/Tests/RunCMake/install/RunCMakeTest.cmake
index e05a1c0..27be9e2 100644
--- a/Tests/RunCMake/install/RunCMakeTest.cmake
+++ b/Tests/RunCMake/install/RunCMakeTest.cmake
@@ -86,6 +86,7 @@ run_install_test(PRE_POST_INSTALL_SCRIPT)
run_install_test(SCRIPT)
run_install_test(TARGETS-CONFIGURATIONS)
run_install_test(DIRECTORY-PATTERN)
+run_install_test(TARGETS-Parts)
set(run_install_test_components 1)
run_install_test(FILES-EXCLUDE_FROM_ALL)
diff --git a/Tests/RunCMake/install/TARGETS-Parts-all-check.cmake b/Tests/RunCMake/install/TARGETS-Parts-all-check.cmake
new file mode 100644
index 0000000..6245839
--- /dev/null
+++ b/Tests/RunCMake/install/TARGETS-Parts-all-check.cmake
@@ -0,0 +1 @@
+check_installed([[^include;include/obj1\.h;lib;lib/(mylib\.lib|(lib|cyg)mylib\.a)$]])
diff --git a/Tests/RunCMake/install/TARGETS-Parts.cmake b/Tests/RunCMake/install/TARGETS-Parts.cmake
new file mode 100644
index 0000000..2a46ab9
--- /dev/null
+++ b/Tests/RunCMake/install/TARGETS-Parts.cmake
@@ -0,0 +1,7 @@
+enable_language(C)
+add_library(mylib STATIC obj1.c)
+set_property(TARGET mylib PROPERTY PUBLIC_HEADER obj1.h)
+install(TARGETS mylib
+ ARCHIVE DESTINATION lib
+ PUBLIC_HEADER DESTINATION include
+ )
diff --git a/Tests/RunCMake/install/obj1.h b/Tests/RunCMake/install/obj1.h
new file mode 100644
index 0000000..d88d5d2
--- /dev/null
+++ b/Tests/RunCMake/install/obj1.h
@@ -0,0 +1,6 @@
+#ifndef OBJ1_H
+#define OBJ1_H
+
+int obj1(void);
+
+#endif /* OBJ1_H */