[CMake] CMake-CPack-NSIS

Eric Noulard eric.noulard at gmail.com
Tue Apr 8 14:56:34 EDT 2008


2008/4/8, Alin M Elena <alin.elena at qub.ac.uk>:
> Thanks Eric,
>
>
>  I reformulate the problem.
>
> >>              I want to setup a variable(TestVar) on windows when I use
>  NSIS
>  >> using cmake/cpack.
>
>  >>                 A small example is presented here
>  >> http://nsis.sourceforge.net/Setting_Environment_Variables
>
> I suspected that the solution will be a combination of the info given above
>  and
>
> CPACK_NSIS_EXTRA_(UN)INSTALL_COMMANDS
>
>
> This model does not work because the extra commands get added in their
>  sections
>  And adding defining a function can be done only outside the section
>  environment.

OK I see.

>
>  Any ideas?

NSIS CPack generator use the following templates:

<CMAKE>/share/cmake-2.<x>/Modules/NSIS.InstallOptions.ini.in
<CMAKE>/share/cmake-2.<x>/Modules/NSIS.template.in

You may replace those template using you own template
which may contains more user-defined CMake variables
(in the appropriate section) which may be replaced by CMake.

If you add your template in your custom module Path
SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)

it should work (not tested though :-)
-- 
Erk


More information about the CMake mailing list