File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -318,6 +318,20 @@ macro(LSLGenerateCPackConfig)
318318 endif ()
319319 set (CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS ON )
320320
321+ # determine architecture for cross-compiled packages
322+ if (CMAKE_CROSSCOMPILING )
323+ if (CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64|arm64)" )
324+ set (CPACK_DEBIAN_PACKAGE_ARCHITECTURE "arm64" )
325+ elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^(armv7|arm)" )
326+ set (CPACK_DEBIAN_PACKAGE_ARCHITECTURE "armhf" )
327+ elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86_64|amd64)" )
328+ set (CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64" )
329+ elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^(i.86|x86)" )
330+ set (CPACK_DEBIAN_PACKAGE_ARCHITECTURE "i386" )
331+ endif ()
332+ message (STATUS "Cross-compiling: Setting Debian package architecture to ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE} (CMAKE_SYSTEM_PROCESSOR=${CMAKE_SYSTEM_PROCESSOR} )" )
333+ endif ()
334+
321335 # include distribution name (e.g. trusty or xenial) in the file name
322336 find_program (LSB_RELEASE lsb_release)
323337 execute_process (COMMAND ${LSB_RELEASE} -cs
You can’t perform that action at this time.
0 commit comments