From d8cef891b9a27cc7bc52477e1c7b2c3f8edf81ba Mon Sep 17 00:00:00 2001 From: Alexis Potvin Date: Tue, 29 Oct 2024 11:44:50 -0400 Subject: [PATCH] Add support for all architecture in debian packaging --- CMakeCPack.cmake | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/CMakeCPack.cmake b/CMakeCPack.cmake index 06794cd721..dabc83271a 100644 --- a/CMakeCPack.cmake +++ b/CMakeCPack.cmake @@ -101,11 +101,20 @@ elseif(CMAKE_SYSTEM_NAME MATCHES "Linux") set(CPACK_RPM_DEV_PACKAGE_REQUIRES "${CPACK_RPM_LIB_PACKAGE_NAME} = ${CPACK_PACKAGE_VERSION}") elseif(EXISTS "/etc/debian_version") set(CPACK_DEB_COMPONENT_INSTALL ON) - if(CMAKE_SIZEOF_VOID_P EQUAL 8) - set(__arch "amd64") - else() - set(__arch "i386") - endif() + find_program(DPKG_CMD dpkg) + if(NOT DPKG_CMD) + if(CMAKE_SIZEOF_VOID_P EQUAL 8) + set(__arch "amd64") + else() + set(__arch "i386") + endif() + else () + execute_process(COMMAND "${DPKG_CMD}" --print-architecture + OUTPUT_VARIABLE __arch + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + endif () + set(CPACK_GENERATOR "DEB;TGZ;${CPACK_GENERATOR}" CACHE STRING "List of package generators")