summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorSarang Joshi <sarangj@msn.com>2020-02-22 00:53:23 (GMT)
committerBrad King <brad.king@kitware.com>2020-02-24 19:31:38 (GMT)
commitc0534c4a68ed421abbda357d98d7f687009751dd (patch)
treeb197d15b3b3efead3ce7fff40400b2843999f3dd /Tests
parent952945813c091c4267590e80bd8e5421fe64508b (diff)
downloadCMake-c0534c4a68ed421abbda357d98d7f687009751dd.zip
CMake-c0534c4a68ed421abbda357d98d7f687009751dd.tar.gz
CMake-c0534c4a68ed421abbda357d98d7f687009751dd.tar.bz2
CPackRPM: Add PRE_/POST_TRANS scripts
Add variables for PRE_TRANS and POST_TRANS scripts. Fixes: #18917
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/VerifyResult.cmake4
-rw-r--r--Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/test.cmake16
2 files changed, 18 insertions, 2 deletions
diff --git a/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/VerifyResult.cmake b/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/VerifyResult.cmake
index d7d82f2..1a1e983 100644
--- a/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/VerifyResult.cmake
+++ b/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/VerifyResult.cmake
@@ -25,5 +25,5 @@ function(checkScripts_ FILE COMPARE_LIST)
endforeach()
endfunction()
-checkScripts_("${FOUND_FILE_1}" "echo \"pre install foo\";echo \"post install foo\";echo \"pre uninstall foo\";echo \"post uninstall foo\"")
-checkScripts_("${FOUND_FILE_2}" "echo \"pre install\";echo \"post install\";echo \"pre uninstall\";echo \"post uninstall\"")
+checkScripts_("${FOUND_FILE_1}" "echo \"pre install foo\";echo \"post install foo\";echo \"pre uninstall foo\";echo \"post uninstall foo\";echo \"pre trans foo\";echo \"post trans foo\"")
+checkScripts_("${FOUND_FILE_2}" "echo \"pre install\";echo \"post install\";echo \"pre uninstall\";echo \"post uninstall\";echo \"pre trans\";echo \"post trans\"")
diff --git a/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/test.cmake b/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/test.cmake
index fb1b8de..c200fa5 100644
--- a/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/test.cmake
+++ b/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/test.cmake
@@ -7,6 +7,10 @@ if(GENERATOR_TYPE STREQUAL "RPM")
"${CMAKE_CURRENT_BINARY_DIR}/pre_uninstall.sh")
set(CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE
"${CMAKE_CURRENT_BINARY_DIR}/post_uninstall.sh")
+ set(CPACK_RPM_PRE_TRANS_SCRIPT_FILE
+ "${CMAKE_CURRENT_BINARY_DIR}/pre_trans.sh")
+ set(CPACK_RPM_POST_TRANS_SCRIPT_FILE
+ "${CMAKE_CURRENT_BINARY_DIR}/post_trans.sh")
set(CPACK_RPM_foo_PRE_INSTALL_SCRIPT_FILE
"${CMAKE_CURRENT_BINARY_DIR}/pre_install_foo.sh")
@@ -16,6 +20,10 @@ if(GENERATOR_TYPE STREQUAL "RPM")
"${CMAKE_CURRENT_BINARY_DIR}/pre_uninstall_foo.sh")
set(CPACK_RPM_foo_POST_UNINSTALL_SCRIPT_FILE
"${CMAKE_CURRENT_BINARY_DIR}/post_uninstall_foo.sh")
+ set(CPACK_RPM_foo_PRE_TRANS_SCRIPT_FILE
+ "${CMAKE_CURRENT_BINARY_DIR}/pre_trans_foo.sh")
+ set(CPACK_RPM_foo_POST_TRANS_SCRIPT_FILE
+ "${CMAKE_CURRENT_BINARY_DIR}/post_trans_foo.sh")
endif()
set(CMAKE_BUILD_WITH_INSTALL_RPATH 1)
@@ -29,6 +37,10 @@ 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")
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/pre_trans.sh"
+ "echo \"pre trans\"\n")
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/post_trans.sh"
+ "echo \"post trans\"\n")
# specific
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/pre_install_foo.sh"
@@ -39,6 +51,10 @@ 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")
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/pre_trans_foo.sh"
+ "echo \"pre trans foo\"\n")
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/post_trans_foo.sh"
+ "echo \"post trans foo\"\n")
install(FILES CMakeLists.txt DESTINATION foo COMPONENT foo)
install(FILES CMakeLists.txt DESTINATION bar COMPONENT bar)