From 2e1a2138b0a9b6a8dc08c54e0036abcdac00c94c Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Thu, 21 Nov 2013 10:46:40 +0100 Subject: [PATCH] Doc: deploying CMake Projects to embedded Linux devices Change-Id: Ia281f0601886abb60a46359966c4f16bb48617f4 Reviewed-by: Oleksii Serdiuk Reviewed-by: Daniel Teske --- doc/src/projects/creator-projects-cmake.qdoc | 63 ++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/doc/src/projects/creator-projects-cmake.qdoc b/doc/src/projects/creator-projects-cmake.qdoc index 54638f942a8..8443334240b 100644 --- a/doc/src/projects/creator-projects-cmake.qdoc +++ b/doc/src/projects/creator-projects-cmake.qdoc @@ -110,6 +110,69 @@ For more information about known issues for the current version, see \l{Known Issues}. + \section1 Deploying CMake Projects to Embedded Linux Devices + + \QC cannot extract files to be installed from a CMake project, and + therefore, only executable targets are automatically added to deployment + files. You must specify all other files in the \c QtCreatorDeployment.txt + file that you create and place in the root directory of the CMake project. + + Use the following syntax in the file: + + \code + + : + ... + : + \endcode + + Where: + + \list + + \li \c{} is the (absolute) path prefix to where files + are copied on the remote machine. + + \li \c{} is the file path relative to the CMake + project root. No directories or wildcards are allowed in this + value. + + \li \c{} is the destination directory path + relative to \c{deployment/prefix}. + + \endlist + + To automate the creation of \c QtCreatorDeployment.txt file: + + \list 1 + + \li Define the following macros in the top level \c CMakeLists.txt file: + + \code + file(WRITE "${CMAKE_SOURCE_DIR}/QtCreatorDeployment.txt" "\n") + + macro(add_deployment_file SRC DEST) + file(RELATIVE_PATH path ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) + file(APPEND "${CMAKE_SOURCE_DIR}/QtCreatorDeployment.txt" "${path}/${SRC}:${DEST}\n") + endmacro() + + macro(add_deployment_directory SRC DEST) + file(GLOB_RECURSE files RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${SRC}/*") + foreach(filename ${files}) + get_filename_component(path ${filename} PATH) + add_deployment_file("${filename}" "${DEST}/${path}") + endforeach(filename) + endmacro() + \endcode + + \li Use \c {add_deployment_file()} to add files and + \c {add_deployment_directory()} to add directories + (including subdirectories) to the \c QtCreatorDeployment.txt file. + + \li Re-run \c cmake after you add or remove files using the macros. + + \endlist + \section1 Adding External Libraries to CMake Projects Through external libraries, \QC can support code completion and syntax