Fix:WIDGET_ENTRY_POINT variable always overwritten
authorRomain Forlot <romain.forlot@iot.bzh>
Mon, 12 Jun 2017 10:50:34 +0000 (12:50 +0200)
committerRomain Forlot <romain.forlot@iot.bzh>
Mon, 12 Jun 2017 10:50:48 +0000 (12:50 +0200)
Change-Id: I429676174add205d60b9cd0d03f091f2533a5182
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
cmake/common.cmake

index 5b030d4..461ea17 100644 (file)
@@ -187,11 +187,13 @@ macro(wgt_package_build)
        if(NOT EXISTS ${WGT_TEMPLATE_DIR}/icon-default.png)
                MESSAGE(FATAL_ERROR "${Red}WARNING ! Missing mandatory files to build widget file.\nYou need ${PROJECT_ICON} file in ${WGT_TEMPLATE_DIR} folder.${ColourReset}")
        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_TYPE)
+               MESSAGE(FATAL_ERROR "WIDGET_TYPE must be set in your config.cmake.\neg.: set(WIDGET_TYPE application/vnd.agl.service)")
+       endif()
 
-    set(WIDGET_ENTRY_POINT lib CACHE STRING "the widget entry point file")
+       if(NOT WIDGET_ENTRY_POINT)
+               set(WIDGET_ENTRY_POINT lib)
+       endif()
 
        configure_file(${WIDGET_CONFIG_TEMPLATE} ${PROJECT_PKG_BUILD_DIR}/config.xml)
        file(COPY ${WGT_TEMPLATE_DIR}/icon-default.png DESTINATION ${PROJECT_PKG_BUILD_DIR})