CPACK_PRE_BUILD_SCRIPTS and CPACK_POST_BUILD_SCRIPTS have no obvious way to access the source, binary or staging directories
CPACK_INSTALL_SCRIPTS run with the following variables set:
CMAKE_INSTALL_PREFIX- set to staging directory
These variables don't get set for the
CPACK_PRE_BUILD_SCRIPTS and the
CPACK_POST_BUILD_SCRIPTS unless you have a
CPACK_INSTALL_SCRIPTS running first.
You can get some of the information you need from CPACK variables:
CPACK_TEMPORARY_INSTALL_DIRECTORY- is set to the staging directory in
CPACK_OUTPUT_FILE_PATH- points to the output file in
I think it would be useful for
CMAKE_CURRENT_BINARY_DIR to be set for both PRE and POST.
CMAKE_INSTALL_PREFIX set for PRE and something else set pointing to the output file in POST.