-EXTRA_OECMAKE_append_agl-ptest = " -DBUILD_TEST_WGT=TRUE"
-
-# FIXME: Remove once CMake+ninja issues are resolved
-OECMAKE_GENERATOR = "Unix Makefiles"
-
-do_aglwgt_package() {
-
- mkdir -p ${S}/build-test
- mkdir -p ${S}/build-debug
- mkdir -p ${S}/build-coverage
-
- pushd ${B}
- ${S}/autobuild/agl/autobuild package BUILD_DIR=${B} DEST=${S}/widgets VERBOSE=TRUE || \
- ( ${S}/conf.d/autobuild/agl/autobuild package BUILD_DIR=${B} DEST=${B}/package VERBOSE=TRUE && \
- ( bbwarn "OBSOLETE: Your autobuild script should be located in :" ; \
- bbwarn "autobuild/agl/ from the project root source folder"; \
- bbwarn "and generate a .wgt file using wgtpack in the build"; \
- bbwarn "root folder calling:" ; \
- bbwarn "./autobuild/agl/autobuild package DEST=<BUILDDIR>" ; \
- bbwarn "See: https://wiki.automotivelinux.org/troubleshooting/app-recipes" \
- )
- ) ||
- ( bbwarn "OBSOLETE: You must have an autobuild script located in:" ; \
- bbwarn "autobuild/agl/ from the project root source folder"; \
- bbwarn "with filename autobuild which should generate"; \
- bbwarn "a .wgt file using wgtpack in the build"; \
- bbwarn "root folder calling:" ; \
- bbwarn "./autobuild/agl/autobuild package DEST=<BUILDDIR>" ; \
- bbwarn "Fix your package as it will not work within the SDK" ; \
- bbwarn "See: https://wiki.automotivelinux.org/troubleshooting/app-recipes"; \
- make package)
- popd
-
- pushd ${S}/build-test
- ${S}/autobuild/agl/autobuild package-test BUILD_DIR=${S}/build-test DEST=${S}/widgets VERBOSE=TRUE || \
- ( bbwarn "Target: package-test failed")
- popd
-
- pushd ${S}/build-debug
- ${S}/autobuild/agl/autobuild package-debug BUILD_DIR=${S}/build-debug DEST=${S}/widgets VERBOSE=TRUE || \
- ( bbwarn "Target: package-debug failed")
- popd
-
- pushd ${S}/build-coverage
- ${S}/autobuild/agl/autobuild package-coverage BUILD_DIR=${S}/build-coverage DEST=${S}/widgets VERBOSE=TRUE || \
- ( bbwarn "Target: package-coverage failed")
- popd
+# Re-enable strip for qmake based projects (default value is "echo")
+OE_QMAKE_STRIP = "${STRIP}"
+
+# Extra build arguments passed to the autobuild script invocations
+AGLWGT_EXTRA_BUILD_ARGS ?= 'VERBOSE=TRUE BUILD_ARGS="${PARALLEL_MAKE}"'
+
+# CMake based widgets that inherit cmake.bbclass will have the
+# following automatically appended to AGLWGT_EXTRA_BUILD_ARGS as
+# the value of CONFIGURE_FLAGS. This definition may need to be
+# extended to include more of what is passed in cmake.bbclass's
+# do_configure if it is found insufficient. Using the generated
+# toolchain.cmake file does fix issues with respect to finding the
+# Qt5 CMake modules that seem difficult to fix otherwise, so at the
+# very minimum it should be present.
+AGLWGT_CMAKE_CONFIGURE_ARGS ?= "-DCMAKE_TOOLCHAIN_FILE=${WORKDIR}/toolchain.cmake ${EXTRA_OECMAKE}"
+
+# Only widgets with recipe names starting with agl-service- are
+# assumed to have tests by default, set this to "1" to force
+# building/packaging of the test widget for other widgets.
+AGLWGT_HAVE_TESTS ?= "0"
+
+# Whether the widget should be auto-installed on first boot
+AGLWGT_AUTOINSTALL ?= "1"
+
+# Signature keys
+# These are default keys for development purposes !
+# Change it for production.
+WGTPKG_AUTOSIGN_0_agl-sign-wgts ??= "${WORKDIR}/recipe-sysroot-native/usr/share/afm/keys/developer.key.pem:${WORKDIR}/recipe-sysroot-native/usr/share/afm/certs/developer.cert.pem"
+WGTPKG_AUTOSIGN_1_agl-sign-wgts ??= "${WORKDIR}/recipe-sysroot-native/usr/share/afm/keys/platform.key.pem:${WORKDIR}/recipe-sysroot-native/usr/share/afm/certs/platform.cert.pem"
+
+export WGTPKG_AUTOSIGN_0
+export WGTPKG_AUTOSIGN_1
+
+python __anonymous () {
+ # NOTE: AGLWGT_CMAKE_CONFIGURE_ARGS is not updated directly here,
+ # but via the prefunc below to avoid issues around anonymous
+ # python ordering conflicts with e.g. externalsrc.bbclass.
+ if bb.data.inherits_class("cmake", d):
+ d.appendVarFlag('do_compile', 'prefuncs', ' aglwgt_cmake_configure')