[CMake] custom NSIS installer

Eric Noulard eric.noulard at gmail.com
Mon May 6 09:00:23 EDT 2013


2013/5/6 Lloyd <lloydkl.tech at gmail.com>:
> I have read this - http://www.cmake.org/Wiki/CMake:CPackNSISAdvancedTips -
> wiki article about executing custom nsis script.
>
> It states that...
>
> "To start work on a custom NSIS script, simply create a file (or copy) into
> your module path (e.g. CPACK_MODULE_PATH) called NSIS.template.in."
>
> Checking the cmake documentation, there is no predefined variable named
> "CPACK_MODULE_PATH".

Yes there is a variable with this name defined in CPack.cmake and used
by CPack executable...but....

it is not documented :-(
(this may be worth a bug report/feature request)

basically if CPACK_MODULE_PATH is not defined by the user
then cpack does;

set(CPACK_MODULE_PATH ${CMAKE_MODULE_PATH})

then CPack uses
CPACK_MODULE_PATH.

> I could find a "NSIS.template.in." in the cmake's (main cmake install
> directory) modules directory. I believe cmake would not ask me to modify
> this file, as each project's nsis template requirement would be different.

If the template fits your needs you do not need to do anything beside
defining the appropriate value for CPACK_NSIS_xxx variable in your
CMakeLists.txt.

If you need more then following what's writtent there
http://www.cmake.org/Wiki/CMake:CPackNSISAdvancedTips
seems OK to me.

> could you please let me know the correct location where I should create the
> template file?

In your project source tree then modify
CPACK_MODULE_PATH or CMAKE_MODULE_PATH in order
to make CPack find yours before the one provided by CMake.



--
Erk
Le gouvernement représentatif n'est pas la démocratie --
http://www.le-message.org


More information about the CMake mailing list