[CMake] smarter shortcuts with NSIS
Eric Noulard
eric.noulard at gmail.com
Tue Feb 28 12:53:00 EST 2012
2012/2/28 Andrea Crotti <andrea.crotti.0 at gmail.com>:
> On 02/28/2012 03:42 PM, Eric Noulard wrote:
>>
>>
>>> At worst is there a way to just create my own .nsi file and use it
>>> directly?
>>> I need to create a page which simply asks for a directory to the user,
>>> and
>>> then use that to create a shortcut..
>>>
>>> Any idea (also other solutions might be fine).
>>
>> 1) Copy the current NSIS.template.in in your project.
>> and update it the way you like.
>>
>> 2) update CMAKE_MODULE_PATH
>> list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/packaging)
>>
>> in order to make your NSIS.template.in in the CMAKE_MODULE_PATH
>> (you can even use CPACK_MODULE_PATH)
>>
>> 3) run-rerun packaging an dmake sure that cpack is using your projevtc
>> specific
>> NSIS.template.in
>>
>
> Ok thanks that's probably the best solution.
> So if I understand correctly this is more or less the same as writing my own
> nsi file,
> run configure_file on it and then add a create_custom_target for packaging,
> is that right?
Yes more or less beside the fact is CPack is doing more work than that:
1) CPack handles CPack-private install location for you
(including the installation of the component selected to be put
in the installer
taken from CPACK_COMPONENTS_ALL)
2) It prepares componentization of the installer.
(including possible COMPONENT dependencies, display name etc...
3) Finally if you use configure_file + add_custom_command you won't get
all the CPACK_xxx vars CPack has :-( Because some of them my be computed
dynamically by CPack which then does the configure_file in this context.
I forgot to mention that "NSIS.template.in" is including an auxiliary file:
"NSIS.InstallOptions.ini.in" which is configured as well.
All this is doable by hand but may not be as easy as it seems in the
general case.
> I will then probably write the file from scratch, trying to understand whaqt
> it does, because the template is quite mysterious at the moment..
Off course you'll have to learn NSIS nsi file syntax
(I may not help you for that since I have no knowledge in this area)
and I think you should have a look at the template as well
for seeking the @CPACK_XXX@ in it
Those are possibly important placeholder CPack will pre-compute for you.
(if you go with CPack and not using add_custom_command).
--
Erk
Le gouvernement représentatif n'est pas la démocratie --
http://www.le-message.org
More information about the CMake
mailing list