summaryrefslogtreecommitdiffstats
path: root/cmake/cmake.d/03-macros.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-10-15 18:22:48 +0200
commit0dfc7f87b215dc12f5314b0df65b3de8f9c97256 (patch)
tree5b3e73352649746269541f428d2ec40495f622cb /cmake/cmake.d/03-macros.cmake
parenta7aef2878fde773eefc59423b06728415c6f17d7 (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/cmake.d/03-macros.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