diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2018-06-15 10:40:01 +0200 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2018-10-15 18:22:48 +0200 |
commit | b23ebd9328d529ebe6a8f5888d44ef57d1d2ada7 (patch) | |
tree | 25eaffc99e515856bc72f5a9be10c0d9a6dcfac9 | |
parent | de552fb43fe9cbb51eaa9458b6565a6a70ed1db3 (diff) |
Fallback using zip format if no wgtpkg-pack found
wgtpkg-pack tool is part of "application-framework-main" project
and not mandatory when developing natively. As a wgt package is
a zip file then use the zip format to simulate a real wgt package.
Change-Id: If2d5a86e93b9c9dc707658b2367f59a7824eddf6
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
-rw-r--r-- | cmake/cmake.d/03-macros.cmake | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/cmake/cmake.d/03-macros.cmake b/cmake/cmake.d/03-macros.cmake index 9df9a10..71f2964 100644 --- a/cmake/cmake.d/03-macros.cmake +++ b/cmake/cmake.d/03-macros.cmake @@ -453,9 +453,19 @@ macro(wgt_package_build) file(COPY "${TEMPLATE_DIR}/etc/*" DESTINATION ${PROJECT_PKG_BUILD_DIR}/etc/) endif(${PROJECT_CONF_FILES}) + find_program(wgtpkgCMD "wgtpkg-pack") + if(wgtpkgCMD) + message(STATUS "------ Create widget using WGTPKG") + set(packCMD ${wgtpkgCMD} "-f" "-o" "${PROJECT_NAME}.wgt" ${PROJECT_PKG_BUILD_DIR}) + else() + message(STATUS "----- Create widget using ZIP") + + set(packCMD cd ${PROJECT_PKG_BUILD_DIR} && ${CMAKE_COMMAND} "-E" "tar" "cf" "../${PROJECT_NAME}.wgt" "--format=zip" "*") + endif() + add_custom_command(OUTPUT ${PROJECT_NAME}.wgt DEPENDS ${PROJECT_TARGETS} - COMMAND wgtpkg-pack -f -o ${PROJECT_NAME}.wgt ${PROJECT_PKG_BUILD_DIR} + COMMAND ${packCMD} ) add_custom_target(widget DEPENDS ${PROJECT_NAME}.wgt) |