Merge topic 'package-cross'

d49a91972d CMakeCPack: Fix package name when crosscompiling

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10396
This commit is contained in:
Brad King 2025-02-27 14:30:44 +00:00 committed by Kitware Robot
commit 0e8776bd7f

View File

@ -28,7 +28,7 @@ set(CPACK_DMG_SLA_USE_RESOURCE_FILE_LICENSE OFF)
# - Root install directory (displayed to end user at installer-run time)
# - "NSIS package/display name" (text used in the installer GUI)
# - Registry key used to store info about the installation
if(CMAKE_CL_64)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64")
set(CPACK_NSIS_PACKAGE_NAME "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION} (Win64)")
else()
@ -40,18 +40,10 @@ set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_NSIS_PACKAGE_NAME}")
if(NOT DEFINED CPACK_SYSTEM_NAME)
# make sure package is not Cygwin-unknown, for Cygwin just
# cygwin is good for the system name
if("x${CMAKE_SYSTEM_NAME}" STREQUAL "xCYGWIN")
set(CPACK_SYSTEM_NAME Cygwin)
if(CMAKE_SYSTEM_NAME STREQUAL "CYGWIN")
set(CPACK_SYSTEM_NAME cygwin)
else()
set(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR})
endif()
endif()
if(${CPACK_SYSTEM_NAME} MATCHES Windows)
if(CMAKE_CL_64)
set(CPACK_SYSTEM_NAME win64-x64)
set(CPACK_IFW_TARGET_DIRECTORY "@RootDir@/Program Files/${CMAKE_PROJECT_NAME}")
else()
set(CPACK_SYSTEM_NAME win32-x86)
string(TOLOWER "${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}" CPACK_SYSTEM_NAME)
endif()
endif()
@ -166,7 +158,7 @@ _cmifwarg("Package <Script> generated"
_cmifwarg("Package <Licenses> tag (pairs of <display_name> <file_path>)"
STRING LICENSES "${${_cpifwrc}LICENSES_DEFAULT}")
if(${CMAKE_SYSTEM_NAME} MATCHES Windows)
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
set(_CPACK_IFW_PACKAGE_ICON
"set(CPACK_IFW_PACKAGE_ICON \"${CMake_SOURCE_DIR}/Source/QtDialog/CMakeSetup.ico\")")
if(BUILD_QtDialog)
@ -185,9 +177,11 @@ if(${CMAKE_SYSTEM_NAME} MATCHES Windows)
)
endif()
if(${CMAKE_SYSTEM_NAME} MATCHES Linux)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(CPACK_IFW_TARGET_DIRECTORY "@HomeDir@/${CMAKE_PROJECT_NAME}")
set(CPACK_IFW_ADMIN_TARGET_DIRECTORY "@ApplicationsDir@/${CMAKE_PROJECT_NAME}")
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
set(CPACK_IFW_TARGET_DIRECTORY "@RootDir@/Program Files/${CMAKE_PROJECT_NAME}")
endif()
# Components scripts configuration