summaryrefslogtreecommitdiffstats
path: root/cmake/cmake.d/03-macros.cmake
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2018-10-15 18:11:16 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2018-10-16 12:55:11 +0200
commit765504ef7989150fd69a0b4023d3dcc36190380a (patch)
tree1b9e3e908ff1572adc6a00107465d73f72325036 /cmake/cmake.d/03-macros.cmake
parent210e7a74326c5e01de42bcb3c2375db92a32a27c (diff)
Use a custom test-config.xml file for test widget
Bug-AGL: SPEC-1821 Change-Id: If664757a7dec8e43cd8f4776bab16d026e583752 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'cmake/cmake.d/03-macros.cmake')
-rw-r--r--cmake/cmake.d/03-macros.cmake10
1 files changed, 7 insertions, 3 deletions
diff --git a/cmake/cmake.d/03-macros.cmake b/cmake/cmake.d/03-macros.cmake
index 4cd34e4..1475c28 100644
--- a/cmake/cmake.d/03-macros.cmake
+++ b/cmake/cmake.d/03-macros.cmake
@@ -470,6 +470,10 @@ macro(remote_targets_populate)
endmacro(remote_targets_populate)
macro(wgt_package_build)
+ if(NOT EXISTS ${TEST_WIDGET_CONFIG_TEMPLATE})
+ MESSAGE(STATUS "${BoldBlue}Notice!:Using default test widget configuration's file.\n-- If you want to use a customized test-config.xml template then specify TEST_WIDGET_CONFIG_TEMPLATE in your config.cmake file.${ColourReset}")
+ set(TEST_WIDGET_CONFIG_TEMPLATE "${CMAKE_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}/test-wgt/test-config.xml.in" CACHE PATH "Path to the test widget config file template (test-config.xml.in)")
+ endif()
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()
@@ -528,8 +532,8 @@ macro(wgt_package_build)
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 ${ICON_PATH} ${PROJECT_PKG_BUILD_DIR}/${PROJECT_ICON}
)
- add_custom_command(OUTPUT ${PROJECT_PKG_TEST_DIR}/test-config.xml ${PROJECT_PKG_TEST_DIR}/bin/launcher
- COMMAND ${CMAKE_COMMAND} -DINFILE=${CMAKE_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}/test-widget/test-config.xml.in -DOUTFILE=${PROJECT_PKG_TEST_DIR}/config.xml -DPROJECT_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR} -P ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}/cmake/configure_file.cmake
+ add_custom_command(OUTPUT ${PROJECT_PKG_TEST_DIR}/config.xml ${PROJECT_PKG_TEST_DIR}/bin/launcher
+ COMMAND ${CMAKE_COMMAND} -DINFILE=${TEST_WIDGET_CONFIG_TEMPLATE} -DOUTFILE=${PROJECT_PKG_TEST_DIR}/config.xml -DPROJECT_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR} -P ${PROJECT_APP_TEMPLATES_DIR}/cmake/configure_file.cmake
COMMAND mkdir -p ${PROJECT_PKG_TEST_DIR}/bin
COMMAND cp ${ICON_PATH} ${PROJECT_PKG_TEST_DIR}/${PROJECT_ICON}
COMMAND cp ${CMAKE_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}/test-widget/launcher.sh.in ${PROJECT_PKG_TEST_DIR}/bin/launcher
@@ -546,7 +550,7 @@ macro(wgt_package_build)
)
if(${BUILD_TEST_WGT})
- add_custom_target(packaging_wgt DEPENDS ${PROJECT_PKG_BUILD_DIR}/config.xml ${PROJECT_PKG_TEST_DIR}/test-config.xml ${PROJECT_PKG_TEST_DIR}/bin/launcher)
+ add_custom_target(packaging_wgt DEPENDS ${PROJECT_PKG_BUILD_DIR}/config.xml ${PROJECT_PKG_TEST_DIR}/config.xml ${PROJECT_PKG_TEST_DIR}/bin/launcher)
add_custom_target(widget DEPENDS ${WGT_NAME}.wgt ${WGT_NAME}-test.wgt)
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "${CMAKE_CURRENT_BINARY_DIR}/${WGT_NAME}-test.wgt")
else()