From b23ebd9328d529ebe6a8f5888d44ef57d1d2ada7 Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Fri, 15 Jun 2018 10:40:01 +0200 Subject: 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 --- cmake/cmake.d/03-macros.cmake | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'cmake') 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) -- cgit 1.2.3-korg