[CMake] [CPack] post install scripts

David Cole david.cole at kitware.com
Thu Jul 21 07:49:31 EDT 2011


On Thu, Jul 21, 2011 at 5:01 AM, Domagoj Saric <
domagoj.saric at littleendian.com> wrote:

> 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:
>>
>> - CPack (with PackageMaker) uses CPACK_PREFLIGHT_SCRIPT,
>> CPACK_POSTFLIGHT_SCRIPT
>> 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?
>>
>
>
> *bump*
>
> 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?
>
>
Just busy, that's all...

install(CODE) and install(SCRIPT) code is run at "make install" time. By
default, CPack does a "make install" to an intermediate location in the
build tree (underneath _CPack_Packages in your build tree) as part of
building the final installer.

I don't know about the CPack post script stuff, or the OS X version
differences you're talking about. I'll have to investigate / take a look
later, but not sure I'll have the time for it this week. If you can give me
easy-to-reproduce steps, that might help.


Hope this helps,
David



>
>
>
> --
> "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
> ______________________________**_________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/**
> opensource/opensource.html<http://www.kitware.com/opensource/opensource.html>
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/**CMake_FAQ<http://www.cmake.org/Wiki/CMake_FAQ>
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/**listinfo/cmake<http://www.cmake.org/mailman/listinfo/cmake>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20110721/185f4f05/attachment.htm>


More information about the CMake mailing list