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 <romain.forlot@iot.bzh>
if(wgtpkgCMD)
set(packCMD ${wgtpkgCMD} "-f" "-o" "${WGT_NAME}.wgt" ${PROJECT_PKG_BUILD_DIR})
else()
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
endif()
add_custom_command(OUTPUT ${WGT_NAME}.wgt