# CPack and post-build actions

**URL:** https://discourse.cmake.org/t/cpack-and-post-build-actions/1296
**Category:** Development
**Created:** [May 30, 2020, 4:40pm UTC](https://discourse.cmake.org/t/cpack-and-post-build-actions/1296 "2020-05-30T16:40:28Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![zaufi](https://discourse.cmake.org/user_avatar/discourse.cmake.org/zaufi/32/116_2.png) [@zaufi](https://discourse.cmake.org/u/zaufi)
#### Post date: [May 30, 2020, 4:40pm UTC](https://discourse.cmake.org/t/cpack-and-post-build-actions/1296/1 "2020-05-30T16:40:29Z")

</div>

Hi,

I’d like to propose to add `CPACK_POST_BUILD_SCRIPTS` variable (plural form to be intact w/ `CPACK_INSTALL_COMMANDS`, `_SCRIPTS` & etc). It’s a list of CMake scripts to perform right **after** CPack has built packages (per generator or altogether is discussible).

What I wanted to solve is to sign RPM/DEB packages built by `cmake ... --target package` that is part of my CTest run.

PS. I’m ready to work on MR for this feature.

---

<div class="post-metadata">

### Author: ![brad.king](https://discourse.cmake.org/user_avatar/discourse.cmake.org/brad.king/32/11_2.png) [@brad.king](https://discourse.cmake.org/u/brad.king)
#### Post date: [June 1, 2020, 10:28am UTC](https://discourse.cmake.org/t/cpack-and-post-build-actions/1296/2 "2020-06-01T10:28:17Z")

</div>

Yes, post-package actions sounds fine to me.

See also [CMake Issue 19077](https://gitlab.kitware.com/cmake/cmake/-/issues/19077) which could benefit from _pre-package_ actions in the staged install directory just before running the packager.
