summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CPack/INSTALL_SCRIPTS.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake/CPack/INSTALL_SCRIPTS.cmake')
-rw-r--r--Tests/RunCMake/CPack/INSTALL_SCRIPTS.cmake26
1 files changed, 26 insertions, 0 deletions
diff --git a/Tests/RunCMake/CPack/INSTALL_SCRIPTS.cmake b/Tests/RunCMake/CPack/INSTALL_SCRIPTS.cmake
new file mode 100644
index 0000000..13aa77b
--- /dev/null
+++ b/Tests/RunCMake/CPack/INSTALL_SCRIPTS.cmake
@@ -0,0 +1,26 @@
+set(CMAKE_BUILD_WITH_INSTALL_RPATH 1)
+
+# default
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/pre_install.sh"
+ "echo \"pre install\"\n")
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/post_install.sh"
+ "echo \"post install\"\n")
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/pre_uninstall.sh"
+ "echo \"pre uninstall\"\n")
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/post_uninstall.sh"
+ "echo \"post uninstall\"\n")
+
+# specific
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/pre_install_foo.sh"
+ "echo \"pre install foo\"\n")
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/post_install_foo.sh"
+ "echo \"post install foo\"\n")
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/pre_uninstall_foo.sh"
+ "echo \"pre uninstall foo\"\n")
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/post_uninstall_foo.sh"
+ "echo \"post uninstall foo\"\n")
+
+install(FILES CMakeLists.txt DESTINATION foo COMPONENT foo)
+install(FILES CMakeLists.txt DESTINATION bar COMPONENT bar)
+
+set(CPACK_PACKAGE_NAME "install_scripts")