[CMake] [CPack] Changing the appearance of the NSIS installer

David Cole david.cole at kitware.com
Wed Jan 24 09:58:52 EST 2007


I know it's 2 months later now, but this has been bugging me hanging around
my inbox waiting for me to get back to it... :-)

This *does* work for me on a Windows machine using CMake 2.4.5 and NSIS
v2.14.

Here are the exact steps I took, and my results, based on a CMake source
tree updated today and using a pre-installed binary of CMake 2.4.5 to drive
the build:
-1- Copied the "CMake/Tests/Tutorial/Step5" directory to a new folder called
"Step6"
-2- Added a copy of "CMake/Modules/NSIS.template.in" to "Step6"
-3- Modified my NSIS.template.in to have some extra comments at the top of
it
-4- Modified the Step6/CMakeLists.txt file by adding the following  lines at
the bottom:
  set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}" ${CMAKE_MODULE_PATH})
  include(CPack)
-5- Configured, built ALL, built PACKAGE

-6- Results: I know it used *my* copy of the NSIS.template.in file because I
inspected "_CPack_Packages/win32/NSIS/project.nsi" after building the
PACKAGE target and my comments from bullet point -3- above were in there...

Now. This is not to say that you can use any old NSIS.template.in file and
get it to work properly. You do have to produce an output file that's named
as CPack expects it to be named so that the rest of the packaging process
works. If all you want to do is rename your output file, though, you can
simply set the variable CPACK_OUTPUT_FILE_NAME before including CPack in
your CMakeLists.txt file.

I would recommend that you start with the NSIS.template.in file that CMake
provides and edit it very carefully, only adding things to it. You can
change/remove things from it if you're sure they're not needed by the rest
of the packaging process that CPack performs. If you are still having
problems getting this to work and you're using CMake 2.4.5 or greater, I
would definitely be interested to hear back from you again. (With detailed
steps on what you are doing and exactly what is failing.) This should
work...


HTH,
David Cole


On 11/13/06, wedekind <wedekind at caesar.de> wrote:
>
> Hello David
>
> > You should be able to use your own NSIS.template.in file if you name it
> > exactly the same as CMake's copy and then add the directory containing
> > your own copy of it to CMAKE_MODULE_PATH.
> >
> > For example, if your copy is in a subdirectory of your source directory
> > named "Templates," you could do this...:
> > SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/Templates"
> > ${CMAKE_MODULE_PATH})
> > ... prior to including the CPack file in your CMakeLists.
> >
> > Let me know if this doesn't work. I haven't tried it myself with this
> > particular file, but it should work...
>
> Unfortunately this does not work for me :( I have set the
> CMAKE_MODULE_PATH
> like you have described but CMake obviously chooses its own
> NSIS.template.in.
>
> Why does overwriting the module path like this does not work? I have done
> it
> in my "root" CMakeLists.txt before including CPack.
>
> Should CMake/CPack be expanded here?
>
> Cheers
>
> Marco
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20070124/3f67dca5/attachment.htm


More information about the CMake mailing list