diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2018-08-23 12:13:01 +0200 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2018-10-23 20:54:23 +0200 |
commit | 6dddf0f9f5f6769db5b3cc41a5d74c371ff93bf9 (patch) | |
tree | 77e22c760e75dd8b7595670d3b81888ea4f15c77 /cmake/cmake.d/03-macros.cmake | |
parent | 100657a2353329f19b8e7c584db3f418472f9959 (diff) |
Convert app-templates to a cmake module
- Changes PATH to find correctly all cmake files.
- Clean useless code now it's integrated as CMake module
- Clean variable usage
- Create module entry point
Bugs-AGL: SPEC-1682
Change-Id: I6943129677603b786c7144a92880d82795a916cd
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.cmake | 28 |
1 files changed, 4 insertions, 24 deletions
diff --git a/cmake/cmake.d/03-macros.cmake b/cmake/cmake.d/03-macros.cmake index 4cd34e4..bb5e2b5 100644 --- a/cmake/cmake.d/03-macros.cmake +++ b/cmake/cmake.d/03-macros.cmake @@ -491,7 +491,7 @@ macro(wgt_package_build) elseif(EXISTS "${WIDGET_ICON}") set(ICON_PATH "${WIDGET_ICON}") else() - set(ICON_PATH ${CMAKE_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}/wgt/icon-default.png) + set(ICON_PATH ${PROJECT_APP_TEMPLATES_DIR}/wgt/icon-default.png) endif() if(NOT WIDGET_ENTRY_POINT) @@ -525,14 +525,14 @@ macro(wgt_package_build) endif() 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 ${CMAKE_COMMAND} -DINFILE=${WIDGET_CONFIG_TEMPLATE} -DOUTFILE=${PROJECT_PKG_BUILD_DIR}/config.xml -DPROJECT_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR} -P ${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 + COMMAND ${CMAKE_COMMAND} -DINFILE=${PROJECT_APP_TEMPLATES_DIR}/test-wgt/test-config.xml.in -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 + COMMAND cp ${PROJECT_APP_TEMPLATES_DIR}/test-wgt/launcher.sh.in ${PROJECT_PKG_TEST_DIR}/bin/launcher ) add_custom_command(OUTPUT ${WGT_NAME}.wgt @@ -634,23 +634,3 @@ macro(project_closing_msg) ${PROJECT_TARGETS} populate) endif() endmacro() - -macro(check_version) - if(GIT_PROJECT_VERSION) - if(${GIT_PROJECT_VERSION} VERSION_GREATER ${APP_TEMPLATES_VERSION}) - message(STATUS "${Yellow}.. Your app-templates submodule version seems outdated. You should update it with 'git submodule update --remote ${PROJECT_APP_TEMPLATES_DIR}'. - - App-templates version: ${APP_TEMPLATES_VERSION} - - Project version according AGL Git tag: ${GIT_PROJECT_VERSION}" - ) - endif() - elseif(PROJECT_VERSION) - if(${PROJECT_VERSION} VERSION_GREATER ${APP_TEMPLATES_VERSION}) - message(STATUS "${Yellow}.. Your app-templates submodule version seems outdated. You should update it with 'git submodule update --remote ${PROJECT_APP_TEMPLATES_DIR}'. - - App-templates version: ${APP_TEMPLATES_VERSION} - - Project version according AGL Git tag: ${PROJECT_VERSION}" - ) - endif() - else() - message(STATUS "${Yellow} Your git project repo doesn't have any version tags nor hosted by AGL gerrit infrastructure. Can't compare version between project and app-templates ${APP_TEMPLATES_VERSION} ${ColourReset}") - endif() -endmacro() |