summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cmake/cmake.d/02-variables.cmake7
-rw-r--r--cmake/cmake.d/03-macros.cmake18
-rw-r--r--samples.d/config.cmake.sample4
3 files changed, 16 insertions, 13 deletions
diff --git a/cmake/cmake.d/02-variables.cmake b/cmake/cmake.d/02-variables.cmake
index 7950880..e580263 100644
--- a/cmake/cmake.d/02-variables.cmake
+++ b/cmake/cmake.d/02-variables.cmake
@@ -131,13 +131,12 @@ endif()
# Paths to templates files
set(TEMPLATE_DIR "${PKG_TEMPLATE_PREFIX}/template.d" CACHE PATH "Subpath to a directory where are stored needed files to launch on remote target to debuging purposes")
-if(NOT WIDGET_CONFIG_TEMPLATE)
- set(WIDGET_CONFIG_TEMPLATE ${TEMPLATE_DIR}/config.xml.in CACHE PATH "Path to widget config file template (config.xml.in)")
-endif()
-
string(REGEX REPLACE "^(.*)/.*$" "\\1" ENTRY_POINT "${PKG_TEMPLATE_PREFIX}")
set(PROJECT_PKG_ENTRY_POINT ${ENTRY_POINT}/packaging CACHE PATH "Where package build files, like rpm.spec file or config.xml, are write.")
+set(WIDGET_ICON "${ENTRY_POINT}/wgt/${PROJECT_ICON}" CACHE PATH "Path to the widget icon")
+set(WIDGET_CONFIG_TEMPLATE ${TEMPLATE_DIR}/config.xml.in CACHE PATH "Path to widget config file template (config.xml.in)")
+
# Path to autobuild template
set(PROJECT_TEMPLATE_AGL_AUTOBUILD_DIR ${CMAKE_SOURCE_DIR}/conf.d/autobuild/agl CACHE PATH "Subpath to a directory where are stored autobuild script")
set(PROJECT_TEMPLATE_LINUX_AUTOBUILD_DIR ${CMAKE_SOURCE_DIR}/conf.d/autobuild/linux CACHE PATH "Subpath to a directory where are stored autobuild script")
diff --git a/cmake/cmake.d/03-macros.cmake b/cmake/cmake.d/03-macros.cmake
index 57cae98..099dc70 100644
--- a/cmake/cmake.d/03-macros.cmake
+++ b/cmake/cmake.d/03-macros.cmake
@@ -338,16 +338,20 @@ macro(wgt_package_build)
endif()
if(NOT DEFINED PROJECT_ICON)
if( ${WIDGET_TYPE} MATCHES "agl.native")
- set(PROJECT_ICON ${PKG_APP_TEMPLATE_DIR}/wgt/icon-native.png)
+ set(ICON_PATH ${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)
+ set(ICON_PATH ${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)
+ set(ICON_PATH ${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)
+ set(ICON_PATH ${PKG_APP_TEMPLATE_DIR}/wgt/icon-html5.png)
endif()
+ elseif(EXISTS "${CMAKE_SOURCE_DIR}/${WIDGET_ICON}")
+ set(ICON_PATH "${CMAKE_SOURCE_DIR}/${WIDGET_ICON}")
+ elseif(EXISTS "${WIDGET_ICON}")
+ set(ICON_PATH "${WIDGET_ICON}")
+ else()
+ set(ICON_PATH ${CMAKE_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}/wgt/icon-default.png)
endif()
if(NOT WIDGET_ENTRY_POINT)
@@ -356,7 +360,7 @@ macro(wgt_package_build)
add_custom_command(OUTPUT ${PROJECT_PKG_BUILD_DIR}/config.xml
COMMAND ${CMAKE_COMMAND} -DINFILE=${WIDGET_CONFIG_TEMPLATE} -DOUTFILE=${PROJECT_PKG_BUILD_DIR}/config.xml -DPROJECT_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR} -P ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}/cmake/configure_file.cmake
- COMMAND cp ${TEMPLATE_DIR}/icon-default.png ${PROJECT_PKG_BUILD_DIR}/${PROJECT_ICON}
+ COMMAND cp ${ICON_PATH} ${PROJECT_PKG_BUILD_DIR}/${PROJECT_ICON}
)
add_custom_target(packaging_wgt DEPENDS ${PROJECT_PKG_BUILD_DIR}/config.xml)
diff --git a/samples.d/config.cmake.sample b/samples.d/config.cmake.sample
index a4fc514..3585988 100644
--- a/samples.d/config.cmake.sample
+++ b/samples.d/config.cmake.sample
@@ -105,8 +105,8 @@ set(LD_LIBRARY_PATH ${CMAKE_INSTALL_PREFIX}/lib64 ${CMAKE_INSTALL_PREFIX}/lib)
# Optional location for config.xml.in
# -----------------------------------
-set(WIDGET_ICON ${PROJECT_APP_TEMPLATES_DIR}/wgt/${PROJECT_ICON})
-#set(WIDGET_CONFIG_TEMPLATE ${CMAKE_CURRENT_SOURCE_DIR}/conf.d/wgt/config.xml.in)
+#set(WIDGET_ICON conf.d/wgt/${PROJECT_ICON} CACHE PATH "Path to the widget icon")
+#set(WIDGET_CONFIG_TEMPLATE ${CMAKE_CURRENT_SOURCE_DIR}/conf.d/wgt/config.xml.in CACHE PATH "Path to widget config file template (config.xml.in)")
# Mandatory widget Mimetype specification of the main unit
# --------------------------------------------------------------------------