cpack -D CPACK_PACKAGING_INSTALL_PREFIX breaks postinst scripts
Within the attached tarball, run 'test.sh' (after examining it, of course) to observe the problematic behavior.
Expected behavior:
INSTALL_DIR becomes set to the path specified on the command line.
Actual behavior:
INSTALL_DIR retains the setting placed within the CMakeLists.txt file.
NOTE:
I understand why this happens. The postinst file is generated during build, not during packaging, and as a consequence the postinst file gets the variable provided during build, not the one provided at the command line.
Still, the documentation leads one to believe the variable becomes resolved within CPack when it creates the package, leading to misplaced expectations here.