Skip to content

Commit d8cef89

Browse files
AlexisPotvinARAeboasson
authored andcommitted
Add support for all architecture in debian packaging
1 parent 3059113 commit d8cef89

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

CMakeCPack.cmake

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,20 @@ elseif(CMAKE_SYSTEM_NAME MATCHES "Linux")
101101
set(CPACK_RPM_DEV_PACKAGE_REQUIRES "${CPACK_RPM_LIB_PACKAGE_NAME} = ${CPACK_PACKAGE_VERSION}")
102102
elseif(EXISTS "/etc/debian_version")
103103
set(CPACK_DEB_COMPONENT_INSTALL ON)
104-
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
105-
set(__arch "amd64")
106-
else()
107-
set(__arch "i386")
108-
endif()
104+
find_program(DPKG_CMD dpkg)
105+
if(NOT DPKG_CMD)
106+
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
107+
set(__arch "amd64")
108+
else()
109+
set(__arch "i386")
110+
endif()
111+
else ()
112+
execute_process(COMMAND "${DPKG_CMD}" --print-architecture
113+
OUTPUT_VARIABLE __arch
114+
OUTPUT_STRIP_TRAILING_WHITESPACE
115+
)
116+
endif ()
117+
109118

110119
set(CPACK_GENERATOR "DEB;TGZ;${CPACK_GENERATOR}" CACHE STRING "List of package generators")
111120

0 commit comments

Comments
 (0)