[CMake] Correct syntax for CPACK_NSIS_CREATE_ICONS [SOLVED]

Yegor Yefremov yegor_sub1 at visionsystems.de
Wed Apr 14 03:16:16 EDT 2010


Hi Droscy,

> Hi, probably you need to escape the backslashes 3 times, because when
> cmake passes the option to cpack, it removes one escape, and cpack does
> the same when creating nsis file. And you can also use single quote mark
> in order to get the quotation on the final nsis file.
> 
> So your command should be
> set(CPACK_NSIS_CREATE_ICONS "CreateShortCut
> '\$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\${PROJECT_NAME}.lnk'
> '\$INSTDIR\\\\${PROJECT_NAME}.exe'")
> 
> A similar command that I use is
> set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "CreateShortcut
> '$desktop\\\\${PROJECT_NAME}.lnk' '$instdir\\\\bin\\\\${PROJECT_NAME}.exe'")
> and it works correctly.

Thank you for the hint. It is working like a charm. I've even tried a folder name with blanks and it was correctly installed afterwards. 

Regards,
Yegor


More information about the CMake mailing list