CPack NSIS example

源赖朝源赖朝
1 min read
#Installation;
if(WIN32)
install(TARGETS ${proj} RUNTIME DESTINATION bin)
install(FILES ${SQLite3_LIBRARIES}/sqlite3.dll DESTINATION bin)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/resources/share DESTINATION bin)
install(FILES ${CMAKE_SOURCE_DIR}/LICENSE.txt DESTINATION .)
#set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION .)
set(CPACK_NSIS_MUI_ICON ${CMAKE_SOURCE_DIR}/resources/app_icon.ico)
set(CPACK_NSIS_MODIFY_PATH "ON")
set(CPACK_CREATE_DESKTOP_LINKS ${proj})
set(CPACK_PACKAGE_EXECUTABLES ${proj} ${APP_NAME})
endif()
set(CPACK_PACKAGE_NAME ${APP_NAME})
set(CPACK_PACKAGE_VERSION ${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}.${APP_VERSION_FIX})
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR})
set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_SOURCE_DIR}/LICENSE.txt)

include(InstallRequiredSystemLibraries)
include(CPack)
0
Subscribe to my newsletter

Read articles from 源赖朝 directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

源赖朝
源赖朝