aboutsummaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2018-07-13 16:30:56 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2018-07-16 13:34:48 +0000
commit6fb38467ca1609a1aa1be865b38648f37861af7e (patch)
treec6445aca49469a3017986f91f33de1df6dd92adf /cmake
parent35f3af1c85bc2f77c41313a4754bed96856b6d8d (diff)
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 <romain.forlot@iot.bzh>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/cmake.d/03-macros.cmake7
1 files changed, 6 insertions, 1 deletions
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