X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=cmake%2Fcmake.d%2F02-macros.cmake;h=aa7d33dde85c603bf8a9e9cef05494d98c121e08;hb=ff2dc9445807ad930306f6ff386957fd8a38ad1d;hp=3e4b9197202aff8fb100c7f80c62b8e326833bc7;hpb=474a2e91501c5620e2eef651c8305f2ae7aacd19;p=apps%2Fapp-templates.git diff --git a/cmake/cmake.d/02-macros.cmake b/cmake/cmake.d/02-macros.cmake index 3e4b919..aa7d33d 100644 --- a/cmake/cmake.d/02-macros.cmake +++ b/cmake/cmake.d/02-macros.cmake @@ -223,12 +223,22 @@ macro(wgt_package_build) if(NOT EXISTS ${WIDGET_CONFIG_TEMPLATE}) MESSAGE(FATAL_ERROR "${Red}WARNING ! Missing mandatory files to build widget file.\nYou need a config.xml template: please specify WIDGET_CONFIG_TEMPLATE correctly.${ColourReset}") endif() - if(NOT EXISTS ${TEMPLATE_DIR}/icon-default.png) - MESSAGE(FATAL_ERROR "${Red}WARNING ! Missing mandatory files to build widget file.\nYou need ${PROJECT_ICON} file in ${TEMPLATE_DIR} folder.${ColourReset}") + if(NOT WIDGET_TYPE) + MESSAGE(FATAL_ERROR "WIDGET_TYPE must be set in your config.cmake.\neg.: set(WIDGET_TYPE application/vnd.agl.service)") + endif() + if(NOT DEFINED PROJECT_ICON) + if( ${WIDGET_TYPE} MATCHES "agl.native") + set(PROJECT_ICON ${PKG_APP_TEMPLATE_DIR}/wgt/icon-native.png) + elseif( ${WIDGET_TYPE} MATCHES "agl.service") + set(PROJECT_ICON ${PKG_APP_TEMPLATE_DIR}/wgt/icon-service.png) + elseif( ${WIDGET_TYPE} MATCHES "x-executable") + set(PROJECT_ICON ${PKG_APP_TEMPLATE_DIR}/wgt/icon-qml.png) + elseif( ${WIDGET_TYPE} MATCHES "text/html") + set(PROJECT_ICON ${PKG_APP_TEMPLATE_DIR}/wgt/icon-html5.png) + else() + set(PROJECT_ICON ${PKG_APP_TEMPLATE_DIR}/wgt/icon-default.png) + endif() endif() - if(NOT WIDGET_TYPE) - MESSAGE(FATAL_ERROR "WIDGET_TYPE must be set in your config.cmake.\neg.: set(WIDGET_TYPE application/vnd.agl.service)") - endif() if(NOT WIDGET_ENTRY_POINT) set(WIDGET_ENTRY_POINT lib)