From 0dfc7f87b215dc12f5314b0df65b3de8f9c97256 Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Fri, 13 Jul 2018 16:30:56 +0200 Subject: Warning if not using wgtpkg-pack to make a widget Also use zip host command instead of embedded CMake zip command which could not be unzipped on a board. Using the host zip command it allows to build the wgt file as a zip archive but it can't be installed using afm-util like a real widget file but could still be unzipped manually. Change-Id: I5e13c27164294d99de1918df8d84cb04fc439317 Signed-off-by: Romain Forlot --- cmake/cmake.d/03-macros.cmake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'cmake') diff --git a/cmake/cmake.d/03-macros.cmake b/cmake/cmake.d/03-macros.cmake index 5595e63..ba4c470 100644 --- a/cmake/cmake.d/03-macros.cmake +++ b/cmake/cmake.d/03-macros.cmake @@ -474,7 +474,12 @@ macro(wgt_package_build) if(wgtpkgCMD) set(packCMD ${wgtpkgCMD} "-f" "-o" "${WGT_NAME}.wgt" ${PROJECT_PKG_BUILD_DIR}) else() - set(packCMD cd ${PROJECT_PKG_BUILD_DIR} && ${CMAKE_COMMAND} "-E" "tar" "cf" "../${WGT_NAME}.wgt" "--format=zip" "*") + find_program(wgtpkgCMD "zip") + if(wgtpkgCMD) + set(packCMD ${CMAKE_COMMAND} -E cmake_echo_color --yellow "Warning: Widget will be built using Zip, NOT using the Application Framework widget pack command." && cd ${PROJECT_PKG_BUILD_DIR} && ${wgtpkgCMD} "../${WGT_NAME}.wgt" "*") + else() + set(packCMD ${CMAKE_COMMAND} -E cmake_echo_color --red "Error: No utility found to build a widget. Either install wgtpkg-pack from App Framework or zip command") + endif() endif() add_custom_command(OUTPUT ${WGT_NAME}.wgt -- cgit 1.2.3-korg