CMakeLists.txt 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. set(CPACK_PACKAGE_NAME "Neovim")
  2. set(CPACK_PACKAGE_VENDOR "neovim.io")
  3. set(CPACK_PACKAGE_FILE_NAME "nvim")
  4. set(CPACK_PACKAGE_DIRECTORY ${PROJECT_BINARY_DIR})
  5. # From the GitHub About section
  6. set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Vim-fork focused on extensibility and usability.")
  7. set(CPACK_PACKAGE_INSTALL_DIRECTORY ${CPACK_PACKAGE_NAME})
  8. # Pull the versions defined with the top level CMakeLists.txt
  9. set(CPACK_PACKAGE_VERSION_MAJOR ${NVIM_VERSION_MAJOR})
  10. set(CPACK_PACKAGE_VERSION_MINOR ${NVIM_VERSION_MINOR})
  11. set(CPACK_PACKAGE_VERSION_PATCH ${NVIM_VERSION_PATCH})
  12. # CPACK_VERBATIM_VARIABLES ensures that the variables prefixed with *CPACK_*
  13. # are correctly passed to the cpack program.
  14. # This should always be set to true.
  15. set(CPACK_VERBATIM_VARIABLES TRUE)
  16. set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE.txt")
  17. set(CPACK_RESOURCE_FILE_README ${PROJECT_SOURCE_DIR}/README.md)
  18. if(WIN32)
  19. set(CPACK_PACKAGE_FILE_NAME "nvim-win64")
  20. set(CPACK_GENERATOR ZIP WIX)
  21. # WIX
  22. # CPACK_WIX_UPGRADE_GUID should be set, but should never change.
  23. # CPACK_WIX_PRODUCT_GUID should not be set (leave as default to auto-generate).
  24. # The following guid is just a randomly generated guid that's been pasted here.
  25. # It has no special meaning other than to supply it to WIX.
  26. set(CPACK_WIX_UPGRADE_GUID "207A1A70-7B0C-418A-A153-CA6883E38F4D")
  27. set(CPACK_WIX_PRODUCT_ICON ${PROJECT_SOURCE_DIR}/runtime/neovim.ico)
  28. # Create start menu and desktop shortcuts
  29. set(CPACK_WIX_PROGRAM_MENU_FOLDER "${CPACK_PACKAGE_NAME}")
  30. set(CPACK_PACKAGE_EXECUTABLES "nvim" "Neovim" "nvim-qt" "Neovim Qt")
  31. set(CPACK_CREATE_DESKTOP_LINKS "nvim-qt")
  32. # We use a wix patch to add further options to the installer. At present, it just adds neovim to the path
  33. # on installation and defines per-user installation, however, it can be extended.
  34. # See: https://cmake.org/cmake/help/v3.7/module/CPackWIX.html#variable:CPACK_WIX_PATCH_FILE
  35. list(APPEND CPACK_WIX_EXTENSIONS WixUtilExtension)
  36. list(APPEND CPACK_WIX_PATCH_FILE ${CMAKE_CURRENT_LIST_DIR}/WixPatch.xml)
  37. elseif(APPLE)
  38. set(CPACK_PACKAGE_FILE_NAME "nvim-macos")
  39. set(CPACK_GENERATOR TGZ)
  40. set(CPACK_PACKAGE_ICON ${CMAKE_CURRENT_LIST_DIR}/neovim.icns)
  41. elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
  42. set(CPACK_PACKAGE_FILE_NAME "nvim-linux64")
  43. set(CPACK_GENERATOR TGZ DEB)
  44. set(CPACK_DEBIAN_PACKAGE_NAME "Neovim") # required
  45. set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Neovim.io") # required
  46. # Automatically compute required shared lib dependencies.
  47. # Unfortunately, you "just need to know" that this has a hidden
  48. # dependency on dpkg-shlibdeps whilst using a debian based host.
  49. set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS TRUE)
  50. else()
  51. set(CPACK_GENERATOR TGZ)
  52. endif()
  53. # CPack variables are loaded in on the call to include(CPack). If you set
  54. # variables *after* the inclusion, they don't get updated within the CPack
  55. # config. Note that some CPack commands should still be run after it, such
  56. # as cpack_add_component().
  57. include(CPack)