我在CMake 2.8.1中使用NSIS包生成器来分发Qt应用程序.一切都工作正常......除了使用CPACK_CREATE_DESKTOP_LINKS
创建应用程序的桌面链接.
我查看了CMake源代码(包括它自己的"bootstrap"windows安装定义),据我所知,我做的是同样的事情.
这是我CMakeLists.txt
文件的相关部分.
set(CPACK_GENERATOR NSIS) set(CPACK_NSIS_PACKAGE_NAME "${EWS_APP_NAME}") set(CPACK_NSIS_DISPLAY_NAME "${EWS_APP_NAME}") set(CPACK_NSIS_CONTACT "${EWS_EMAIL}") set(CPACK_PACKAGE_EXECUTABLES "${EXE_TARGET_NAME}" "${EWS_APP_NAME}") set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CMAKE_PROJECT_NAME}-${EWS_VERSION}") # this works set(CPACK_NSIS_MENU_LINKS "${EWS_WEBSITE}" "Homepage for ${EWS_APP_NAME}") # this doesn't set(CPACK_CREATE_DESKTOP_LINKS "${EXE_TARGET_NAME}") # Icon in the add/remove control panel. Must be an .exe file set(CPACK_NSIS_INSTALLED_ICON_NAME bin\\\\${EXE_TARGET_NAME}.exe) set(CPACK_NSIS_URL_INFO_ABOUT "${EWS_WEBSITE}") set(CPACK_NSIS_HELP_LINK "${EWS_WEBSITE}")
任何想法或调试技巧表示赞赏!
尝试将此添加到您的CMakeLists.txt
:
set (CPACK_NSIS_MODIFY_PATH "ON")
我认为应该在许可证之后添加一个页面,该页面提供了将安装目录添加到路径的选项,并添加了创建桌面链接的选项.