summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastien Douheret <sebastien.douheret@iot.bzh>2017-06-09 14:46:54 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2018-10-15 18:22:47 +0200
commit37e7d375625f311bb14eef8c9a1b6477c231cf72 (patch)
treef0db0578fd8c9735316238d4aea384cdfb513a67
parentabed929fbb7596a8de3748b4074137df42e12b23 (diff)
Set default value for APP_TEMPLATES_DIR and WIDGET_ENTRY_POINT
Change-Id: I275373636bfa4e33e0c82ff934971ee17501bfe1 Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
-rw-r--r--cmake/common.cmake17
-rw-r--r--cmake/config.cmake.sample2
2 files changed, 13 insertions, 6 deletions
diff --git a/cmake/common.cmake b/cmake/common.cmake
index 3cbd9ad..18dfeae 100644
--- a/cmake/common.cmake
+++ b/cmake/common.cmake
@@ -113,7 +113,7 @@ macro(project_targets_populate)
COMMAND cp ${BD}/${P}${OUT}.so ${PACKAGE_LIBDIR}
)
add_custom_target(${POPULE_PACKAGE_TARGET} DEPENDS ${PACKAGE_LIBDIR}/${P}${TARGET}.so)
- add_dependencies(populate ${POPULE_PACKAGE_TARGET})
+ add_dependencies(populate ${POPULE_PACKAGE_TARGET})
elseif(${T} STREQUAL "EXECUTABLE")
add_custom_command(OUTPUT ${PACKAGE_BINDIR}/${P}${TARGET}
DEPENDS ${TARGET}
@@ -121,7 +121,7 @@ macro(project_targets_populate)
COMMAND cp ${BD}/${P}${OUT} ${PACKAGE_BINDIR}
)
add_custom_target(${POPULE_PACKAGE_TARGET} DEPENDS ${PACKAGE_BINDIR}/${P}${TARGET})
- add_dependencies(populate ${POPULE_PACKAGE_TARGET})
+ add_dependencies(populate ${POPULE_PACKAGE_TARGET})
elseif(${T} STREQUAL "HTDOCS")
add_custom_command(OUTPUT ${PACKAGE_HTTPDIR}-xx
DEPENDS ${TARGET}
@@ -130,7 +130,7 @@ macro(project_targets_populate)
COMMAND cp -r ${BD}/${P}${OUT}/* ${PACKAGE_HTTPDIR}
)
add_custom_target(${POPULE_PACKAGE_TARGET} DEPENDS ${PACKAGE_HTTPDIR}-xx)
- add_dependencies(populate ${POPULE_PACKAGE_TARGET})
+ add_dependencies(populate ${POPULE_PACKAGE_TARGET})
elseif(${T} STREQUAL "DATA")
add_custom_command(OUTPUT ${PACKAGE_DATADIR}-xx
DEPENDS ${TARGET}
@@ -139,7 +139,7 @@ macro(project_targets_populate)
COMMAND cp -r ${BD}/${P}${OUT} ${PACKAGE_DATADIR}
)
add_custom_target(${POPULE_PACKAGE_TARGET} DEPENDS ${PACKAGE_DATADIR}-xx)
- add_dependencies(populate ${POPULE_PACKAGE_TARGET})
+ add_dependencies(populate ${POPULE_PACKAGE_TARGET})
endif(${T} STREQUAL "BINDING")
elseif(${CMAKE_BUILD_TYPE} MATCHES "[Dd][Ee][Bb][Uu][Gg]")
MESSAGE(".. Warning: ${TARGET} ignored when packaging.")
@@ -156,7 +156,7 @@ macro(remote_targets_populate)
endif()
set(
- REMOTE_LAUNCH "Test on target with: ${CMAKE_CURRENT_BINARY_DIR}/target/start-on-${RSYNC_TARGET}.sh"
+ REMOTE_LAUNCH "Test on target with: ${CMAKE_CURRENT_BINARY_DIR}/target/start-on-${RSYNC_TARGET}.sh"
CACHE STRING "Command to start ${PROJECT_NAME} on remote target ${RSYNC_TARGET}"
)
@@ -187,6 +187,11 @@ 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()
+
+ set(WIDGET_ENTRY_POINT lib CACHE STRING "the widget entry point file")
configure_file(${WIDGET_CONFIG_TEMPLATE} ${PROJECT_PKG_BUILD_DIR}/config.xml)
configure_file(${WIDGET_CONFIG_TEMPLATE} ${PROJECT_PKG_ENTRY_POINT}/config.xml)
@@ -365,6 +370,8 @@ else()
set(PROJECT_PKG_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/package CACHE PATH "Application contents to be packaged")
endif()
+set (PROJECT_APP_TEMPLATES_DIR "conf.d/templates" CACHE PATH "Default Templates directory")
+
set (PKG_TEMPLATE_PREFIX ${CMAKE_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR} CACHE PATH "Default Package Templates Directory")
set(SSH_TEMPLATE_DIR "${PKG_TEMPLATE_PREFIX}/ssh" CACHE PATH "Subpath to a directory where are stored needed files to launch on remote target to debuging purposes")
set(GDB_TEMPLATE_DIR "${PKG_TEMPLATE_PREFIX}/gdb" CACHE PATH "Subpath to a directory where are stored needed files to launch debuging server on a remote target. Use gdbserver.")
diff --git a/cmake/config.cmake.sample b/cmake/config.cmake.sample
index 9573598..514a80f 100644
--- a/cmake/config.cmake.sample
+++ b/cmake/config.cmake.sample
@@ -31,7 +31,7 @@ set(PROJECT_LANGUAGES,"C")
# Where are stored default templates files from submodule or subtree app-templates in your project tree
# relative to the root project directory
-set(PROJECT_APP_TEMPLATES_DIR "conf.d/default")
+set(PROJECT_APP_TEMPLATES_DIR "conf.d/templates")
# Where are stored your external libraries for your project. This is 3rd party library that you don't maintain
# but used and must be built and linked.