- include (TargetArch)
- target_architecture (DETECTED_ARCH)
- message( INFO " - Target arch is ${DETECTED_ARCH}")
-
- set(CPACK_GENERATOR "DEB")
- set(OPKG_ARCH ${DETECTED_ARCH})
+ # Get target package arch from Yocto ADT sysroot if set or host OS, mapping to Ubuntu name if necessary
+ if (DEFINED ENV{OECORE_TARGET_SYSROOT})
+ GET_FILENAME_COMPONENT (DETECTED_SYSROOT $ENV{OECORE_TARGET_SYSROOT} NAME)
+ string (REGEX REPLACE "-poky-linux" "" TARGET_ARCH "${DETECTED_SYSROOT}")
+ else ()
+ # debian uses amd64 to denote x86_64
+ if (DETECTED_ARCH STREQUAL "x86_64")
+ set (TARGET_ARCH "amd64")
+ else ()
+ set (TARGET_ARCH ${DETECTED_ARCH})
+ endif ()
+ endif ()
+ message (INFO " - Package arch is ${TARGET_ARCH}")
+
+ set(CPACK_GENERATOR "DEB" "TGZ")
+ set(OPKG_ARCH ${TARGET_ARCH})