[CMake] Correct syntax for CPACK_NSIS_CREATE_ICONS

Tyler Roscoe tyler at cryptio.net
Tue Apr 13 11:09:26 EDT 2010


On Tue, Apr 13, 2010 at 12:39:13PM +0200, Yegor Yefremov wrote:
> With this expression
> 
> set(CPACK_NSIS_CREATE_ICONS "CreateShortCut \$SMPROGRAMS\\$STARTMENU_FOLDER\\${PROJECT_NAME}.lnk \$INSTDIR\\${PROJECT_NAME}.exe")
> 
> I can successfully create a package, but cmake/cpack shows a warning like this:
> 
> CMake Warning (dev) at D:/NTool/build/CPackConfig.cmake:51 (SET):
>   Syntax error in cmake code at
> 
>     D:/NTool/build/CPackConfig.cmake:51
> 
>   when parsing string
> 
>     CreateShortCut $SMPROGRAMS\$STARTMENU_FOLDER\NTool.lnk $INSTDIR\NTool.exe
> 
>   Invalid escape sequence \N

Isn't there an example in the cmake book about this where you have to
have \\\\ (four backslashes) to survive all the escaping that happens
downstream?

Anyway, to paraphrase a quote I see on slashdot all the time,
backslashes are like violence: if they don't work, apply more. Does it
work if you use \\\\$PPROJECT_NAME}.exe?

tyler


More information about the CMake mailing list