Skip to content

Commit

Permalink
cmake(build): include OS and architecture in package name
Browse files Browse the repository at this point in the history
Windows only for now.
  • Loading branch information
trollixx committed Sep 11, 2023
1 parent eadc5fc commit f87563b
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,24 @@ set(CPACK_PACKAGE_NAME ${CMAKE_PROJECT_NAME})
set(CPACK_PACKAGE_DESCRIPTION ${CMAKE_PROJECT_DESCRIPTION})
set(CPACK_PACKAGE_VENDOR ${PROJECT_COMPANY_NAME})
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
set(CPACK_PACKAGE_FILE_NAME "${_project_output_name}-${ZEAL_VERSION_FULL}")
set(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/src/app/resources/zeal.ico")

# Set binary package file name.
if(WIN32)
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "AMD64")
set(_package_file_name_suffix "-windows-x64")
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "IA64")
set(_package_file_name_suffix "-windows-x64")
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "X86")
set(_package_file_name_suffix "-windows-x86")
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "ARM64")
set(_package_file_name_suffix "-windows-arm64")
else()
set(_package_file_name_suffix "-windows-unknown")
endif()
endif()
set(CPACK_PACKAGE_FILE_NAME "${_project_output_name}-${ZEAL_VERSION_FULL}${_package_file_name_suffix}")

set(CPACK_PACKAGE_INSTALL_DIRECTORY ${CPACK_PACKAGE_NAME})
set(CPACK_PACKAGE_EXECUTABLES ${_project_output_name} ${CPACK_PACKAGE_NAME})
set(CPACK_CREATE_DESKTOP_LINKS ${_project_output_name} ${CPACK_PACKAGE_NAME})
Expand Down

0 comments on commit f87563b

Please sign in to comment.