61 lines
2.4 KiB
CMake
Raw Normal View History

2017-04-14 19:02:05 +02:00
if(GENERATOR_TYPE STREQUAL "RPM")
set(CPACK_RPM_PRE_INSTALL_SCRIPT_FILE
"${CMAKE_CURRENT_BINARY_DIR}/pre_install.sh")
set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE
"${CMAKE_CURRENT_BINARY_DIR}/post_install.sh")
set(CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE
"${CMAKE_CURRENT_BINARY_DIR}/pre_uninstall.sh")
set(CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE
"${CMAKE_CURRENT_BINARY_DIR}/post_uninstall.sh")
2020-08-30 11:54:41 +02:00
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")
2017-04-14 19:02:05 +02:00
set(CPACK_RPM_foo_PRE_INSTALL_SCRIPT_FILE
"${CMAKE_CURRENT_BINARY_DIR}/pre_install_foo.sh")
set(CPACK_RPM_foo_POST_INSTALL_SCRIPT_FILE
"${CMAKE_CURRENT_BINARY_DIR}/post_install_foo.sh")
set(CPACK_RPM_foo_PRE_UNINSTALL_SCRIPT_FILE
"${CMAKE_CURRENT_BINARY_DIR}/pre_uninstall_foo.sh")
set(CPACK_RPM_foo_POST_UNINSTALL_SCRIPT_FILE
"${CMAKE_CURRENT_BINARY_DIR}/post_uninstall_foo.sh")
2020-08-30 11:54:41 +02:00
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")
2017-04-14 19:02:05 +02:00
endif()
2016-07-09 11:21:54 +02:00
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")
2020-08-30 11:54:41 +02:00
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")
2016-07-09 11:21:54 +02:00
# 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")
2020-08-30 11:54:41 +02:00
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")
2016-07-09 11:21:54 +02:00
install(FILES CMakeLists.txt DESTINATION foo COMPONENT foo)
install(FILES CMakeLists.txt DESTINATION bar COMPONENT bar)