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
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to