# Feature: CPACK\_POST\_BUILD\_SCRIPTS code version

**URL:** https://discourse.cmake.org/t/feature-cpack-post-build-scripts-code-version/15855
**Category:** Development
**Created:** [September 28, 2026, 9:53am UTC](https://discourse.cmake.org/t/feature-cpack-post-build-scripts-code-version/15855 "2026-09-28T09:53:45Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Wallby](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/w/4491bb/32.png) [@Wallby](https://discourse.cmake.org/u/Wallby)
#### Post date: [September 28, 2026, 9:53am UTC](https://discourse.cmake.org/t/feature-cpack-post-build-scripts-code-version/15855/1 "2026-09-28T09:53:45Z")

</div>

Would it be feasible to add POST\_BUILD functionality for CPack without having to create external files? As there also are `install(CODE ...)` and `install(SCRIPT ...)`.

Would CPACK\_POST\_BUILD\_CODE work? A list of individual CMake commands the same as `install(CODE ...)` and `add_custom_command(TARGET ... POST_BUILD COMMAND ...)`.

I am using it for a template project, and would prefer to not have to worry about either exposing scripts not intended for external use, or how to keep names in the build directory unique if instead generating the script.
