Re: [CMake] [CPack] post install scripts

2011-07-22 Thread Domagoj Saric

On 21.7.2011. 13:49, David Cole wrote:

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...


Ok, sorry...It just seemed to me that nobody cared about this considering that 
the list does otherwise have noticeable traffic...




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.


So basically install( CODE/SCRIPT ) have any influence on the CPack generated 
installer only if they alter the contents of the directories and/or files that 
go into the installer (as specified by other install() CMake commands)?




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.


As far as the CPack post install scripts go, this is easy to reproduce:
a)
 set( CPACK_POSTFLIGHT_SCRIPT "myscript.sh" )
 set( CPACK_OSX_PACKAGE_VERSION 10.5 )
b)
 set( CPACK_POSTFLIGHT_SCRIPT "myscript.sh" )

For (a) the script does not get included in the installer at all, for (b) it 
does get included but it does not get executed.


You can also easily see why this is so if you fire up PackageMaker, create a 
dummy project and then in the installer properties change the minimum target 
version to 10.5 and then notice how for all components all pre/postflight script 
options have gone and only preinstall and postinstall are left...


It is also not specified in the documentation (or I did not find it) does/should 
CPack automatically include/copy "myscript.sh" into the installer/package 
(whatever the generator used) or does it simply make a 'reference' of some sort 
and the user must somehow manually ensure that the script (the actual file) gets 
included in the installer?


These post install script problems however are secondary for me, as my main 
problem (that I tried to solve with scripts) is how to create symlinks with 
CPack. If there is any other way that works I would be more than grateful if 
someone could share it with me ;)


In this specific case of mine relative symlinks would work good enough, and 
those I can generate manually or at CMake time so if there could be a way to add 
symlinks as symlinks (not as actual files they point to) to the CPack installer 
this specific problem of mine would probably be solved.



In any case, the need for proper portable post install scripting and symlinks 
support in CPack is definitely needed. AFAICT, CMake still supports symlinks 
only on *NIXes while they also exist on Windows since Win2k times...



Thanks in advance ;)


--
"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

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] [CPack] post install scripts

2011-07-21 Thread David Cole
On Thu, Jul 21, 2011 at 5:01 AM, Domagoj Saric <
domagoj.sa...@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
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/**CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/**listinfo/cmake
>
___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] [CPack] post install scripts

2011-07-21 Thread Domagoj Saric

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?




--
"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

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[CMake] [CPack] post install scripts

2011-07-19 Thread Domagoj Saric
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?



--
"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

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake