[CMake] [CPack] post install scripts

Domagoj Saric domagoj.saric at littleendian.com
Thu Jul 21 05:01:30 EDT 2011

On 19.7.2011. 13:41, Domagoj Saric wrote:
> Hi, I'm using CMake 2.8.5 and OS X 10.6.8. I'm trying to create an multi
> component installer with CPack and PackageMaker (an .mpkg) that would create a
> symlink as a post installation step. Simplified: the installer installs
> directories A and B and then I want to add a symlink in directory B that points
> to a file in directory A. I cannot just add the symlink in the installer because
> the user is allowed to change the target root installation directory (i.e. root
> of the system volume or the user directory) so I have to create the symlink
> at/after installation time in order to make it point to the correct location.
> Before even being able to test the post installation script functionality I ran
> into the following problems:
> and CPACK_POSTUPGRADE_SCRIPT which are not available when targeting OS X 10.5 or
> later, only preinstall and postinstall seem to available then. The result is
> that no script is added when set( CPACK_OSX_PACKAGE_VERSION 10.5 )...
> - without set( CPACK_OSX_PACKAGE_VERSION 10.5 ) (defaults to 10.3) specified
> scripts are added to the root Resource folder of the installer (although
> stripped of the .sh extension and renamed to simply preflight, postflight and
> postupgrade) but they do not get executed. The "Scripts directory" (as seen when
> the resulting mpkg is opened in PackageMaker) is also set for the individual
> components but individual script entries are left blank.
> ps. how do install( CODE ) and install( SCRIPT ) relate to CPack? Do they get
> included in the generated installer in some way?


Apologies for nagging but Google searches about CMake, CPack and symlinks show 
that is not a rare problem/question..is there no comment/help on this from the 
CMake devs?

"What Huxley teaches is that in the age of advanced technology, spiritual
devastation is more likely to come from an enemy with a smiling face than
from one whose countenance exudes suspicion and hate."
Neil Postman

More information about the CMake mailing list