CMakeLists.txt 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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")
  31. set(CPACK_WIX_INSTALL_SCOPE "perMachine")
  32. set(CPACK_WIX_UI_REF "WixUI_CustomInstallDir")
  33. list(APPEND CPACK_WIX_EXTRA_SOURCES ${CMAKE_CURRENT_LIST_DIR}/WixUI_CustomInstallDir.wxs)
  34. list(APPEND CPACK_WIX_EXTRA_SOURCES ${CMAKE_CURRENT_LIST_DIR}/CustomInstallDirDlg.wxs)
  35. # We use a wix patch to add further options to the installer.
  36. # See: https://cmake.org/cmake/help/v3.7/module/CPackWIX.html#variable:CPACK_WIX_PATCH_FILE
  37. list(APPEND CPACK_WIX_EXTENSIONS WixUtilExtension)
  38. list(APPEND CPACK_WIX_PATCH_FILE ${CMAKE_CURRENT_LIST_DIR}/WixPatch.xml)
  39. elseif(APPLE)
  40. set(CPACK_PACKAGE_FILE_NAME "nvim-macos-${CMAKE_SYSTEM_PROCESSOR}")
  41. set(CPACK_GENERATOR TGZ)
  42. set(CPACK_PACKAGE_ICON ${CMAKE_CURRENT_LIST_DIR}/neovim.icns)
  43. elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
  44. set(CPACK_PACKAGE_FILE_NAME "nvim-linux64")
  45. set(CPACK_GENERATOR TGZ DEB)
  46. set(CPACK_DEBIAN_PACKAGE_NAME "Neovim") # required
  47. set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Neovim.io") # required
  48. # Automatically compute required shared lib dependencies.
  49. # Unfortunately, you "just need to know" that this has a hidden
  50. # dependency on dpkg-shlibdeps whilst using a debian based host.
  51. set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS TRUE)
  52. else()
  53. set(CPACK_GENERATOR TGZ)
  54. endif()
  55. # CPack variables are loaded in on the call to include(CPack). If you set
  56. # variables *after* the inclusion, they don't get updated within the CPack
  57. # config. Note that some CPack commands should still be run after it, such
  58. # as cpack_add_component().
  59. include(CPack)