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