[CMake] Correct syntax for CPACK_NSIS_CREATE_ICONS

Yegor Yefremov yegor_sub1 at visionsystems.de
Tue Apr 13 06:39:13 EDT 2010


I'm using CPack for NSIS and would like to place my exe file in $SMPROGRAMS\$STARTMENU_FOLDER and not in $SMPROGRAMS\$STARTMENU_FOLDER\bin. The only way to do it is using CPACK_NSIS_CREATE_ICONS.

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

  Policy CMP0010 is not set: Bad variable reference syntax is an error.  Run
  "cmake --help-policy CMP0010" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.
This warning is for project developers.  Use -Wno-dev to suppress it.

CPack: Create package using NSIS
CPack: Install projects

The project.nsis file has then following command for creating a shortcut:

CreateShortCut $SMPROGRAMS\$STARTMENU_FOLDER\NTool.lnk $INSTDIR\NTool.exe

How can I achieve that CreateShortCut looks like it should i.e. with quotations around arguments:

CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\NTool.lnk" "$INSTDIR\NTool.exe"

Best regards,
Yegor


More information about the CMake mailing list