aboutsummaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorSebastien Douheret <sebastien.douheret@iot.bzh>2017-06-15 09:19:08 +0200
committerSebastien Douheret <sebastien.douheret@iot.bzh>2017-06-15 09:21:39 +0200
commitabd65a3d361d1aa73f2dcc2b20b91f740feb560d (patch)
tree5b6b97cea20a784243a82991a41a3ce489367979 /cmake
parent731569245162803678efed3a6940a9490033eceb (diff)
Fix gdb debugging and add widget install on target
Change-Id: I67698bbbfa626e55cbe382afd7e9c5eb699f6149 Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/common.cmake35
-rw-r--r--cmake/config.cmake.sample2
2 files changed, 28 insertions, 9 deletions
diff --git a/cmake/common.cmake b/cmake/common.cmake
index 353e1ec..883886b 100644
--- a/cmake/common.cmake
+++ b/cmake/common.cmake
@@ -173,8 +173,8 @@ macro(remote_targets_populate)
add_custom_target(remote-target-populate
DEPENDS populate
- COMMAND chmod +x ${CMAKE_CURRENT_BINARY_DIR}/target/start-on-${RSYNC_TARGET}.sh
- COMMAND rsync --archive --delete ${PROJECT_PKG_BUILD_DIR}/ ${RSYNC_TARGET}:${RSYNC_PREFIX}/${PROJECT_NAME}
+ COMMAND chmod +x ${CMAKE_CURRENT_BINARY_DIR}/target/*.sh
+ COMMAND rsync -e "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" --archive --delete ${PROJECT_PKG_BUILD_DIR}/ ${RSYNC_TARGET}:${RSYNC_PREFIX}/${PROJECT_NAME}
COMMENT "${REMOTE_LAUNCH}"
)
endif()
@@ -187,9 +187,9 @@ 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()
if(NOT WIDGET_ENTRY_POINT)
set(WIDGET_ENTRY_POINT lib)
@@ -214,6 +214,21 @@ macro(wgt_package_build)
add_dependencies(widget populate)
set(ADDITIONAL_MAKE_CLEAN_FILES, "${PROJECT_NAME}.wgt")
+ if(NOT RSYNC_TARGET)
+ message ("${Yellow}.. Warning: RSYNC_TARGET not defined 'make widget-target-install' not instanciated${ColourReset}")
+ add_custom_target(widget-target-install
+ COMMENT "${Red}*** Fatal: RSYNC_TARGET RSYNC_PREFIX environment variables required with 'make widget-target-install'${ColourReset}"
+ COMMAND exit -1
+ )
+ else()
+ configure_file(${WGT_TEMPLATE_DIR}/install-wgt-on-target.in ${CMAKE_CURRENT_BINARY_DIR}/target/install-wgt-on-${RSYNC_TARGET}.sh)
+ add_custom_target(widget-target-install
+ DEPENDS widget
+ COMMAND chmod +x ${CMAKE_CURRENT_BINARY_DIR}/target/install-wgt-on-${RSYNC_TARGET}.sh
+ COMMAND ${CMAKE_CURRENT_BINARY_DIR}/target/install-wgt-on-${RSYNC_TARGET}.sh
+ )
+ endif()
+
if(PACKAGE_MESSAGE)
add_custom_command(TARGET widget
POST_BUILD
@@ -364,13 +379,17 @@ else()
set(BINDINGS_INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME} CACHE PATH "Where the binding will be installed in your system")
endif()
+set(PKGOUT_DIR package CACHE PATH "Output directory for packages")
+
# Define a default package directory
-if(PACKAGE_PREFIX)
- set(PROJECT_PKG_BUILD_DIR ${PKG_PREFIX}/package CACHE PATH "Application contents to be packaged")
+if(PKG_PREFIX)
+ set(PROJECT_PKG_BUILD_DIR ${PKG_PREFIX}/${PKGOUT_DIR} CACHE PATH "Application contents to be packaged")
else()
- set(PROJECT_PKG_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/package CACHE PATH "Application contents to be packaged")
+ set(PROJECT_PKG_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/${PKGOUT_DIR} 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 43a7547..9e41872 100644
--- a/cmake/config.cmake.sample
+++ b/cmake/config.cmake.sample
@@ -131,7 +131,7 @@ set(WIDGET_ENTRY_POINT EntryPoint_Path_Not_Set)
# Optional force package prefix generation, like widget
# -----------------------------------------------------
-# set(PACKAGE_PREFIX DestinationPath)
+# set(PKG_PREFIX DestinationPath)
# Optional Application Framework security token
# and port use for remote debugging.