when creating a package, I’d like to run some commands on the installed, but not yet packaged executables.
in the scripts in CPACK_INSTALL_SCRIPTS there is the variable CMAKE_INSTALL_PREFIX set to the directory where the temporarily installed files are located.
How do I get to this information in CPACK_PRE_BUILD_SCRIPTS (and maybe CPACK_POST_BUILD_SCRIPTS) ?
(CPACK_PACKAGE_DIRECTORY and CPACK_INSTALL_PREFIX also don’t give me the temporary install dir.)
Is there a reason that CMAKE_PREFIX_PATH is not set the same way when executing those two scripts ?
Ok, I found it in the cmake sources, there are CPACK_TEMPORARY_INSTALL_DIRECTORY and CPACK_TEMPORARY_DIRECTORY (which both point to the same, correct directory) and also CPACK_NATIVE_INSTALL_DIRECTORY. Unfortunately all of them are undocumented.
You can find a previous discussion about this topic here: https://gitlab.kitware.com/cmake/cmake/-/issues/21520
In 2006 the variables CPACK_TEMPORARY_INSTALL_DIRECTORY and CPACK_TEMPORARY_DIRECTORY were still different:
Since 2008 those two variables are the same:
Which one should be the “official” one ?
I think I’d prefer CPACK_TEMPORARY_INSTALL_DIRECTORY, the other one sounds more like a place for random temporary stuff.