[CMake] NSIS, CPACK_PACKAGE_EXECUTABLES and parameters

Jonatan Wallmander jonatan at vovoid.com
Tue Apr 3 07:50:33 EDT 2012


Hi,

I'm on cmake version 2.8.5

I looked in the changelog and couldn't find this, so here goes:


 From what I can tell, NSIS with CPACK_PACKAGE_EXECUTABLES and giving 
parameters to the executable isn't supported.

CMakeLists.txt:
set(CPACK_PACKAGE_EXECUTABLES "my_executable -f;My Executable")

Resulting row in the cpack NSIS cache file:

CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\My Executable.lnk" 
"$INSTDIR\.\my_executable -f.exe"

I propose 2 possible solutions:

1. (best option IMO)

Add support for a 3rd parameter for flags, like so:
set(CPACK_PACKAGE_EXECUTABLES "my_executable;My Executable;-f")

Since executables actually CAN have spaces in them, this would be best.

2. (secondary option)
Add support for parsing the executable on spaces, everything after the 
first space goes last in the call.

I.e. set(CPACK_PACKAGE_EXECUTABLES "my_executable -f;My Executable")



With kind regards

Jonatan Wallmander
Vovoid Media Technologies


More information about the CMake mailing list