CELIX-414: Adds support for creating a CXX deployment, which will compile a C++ launcer executable and updates the add_deploy documentation
Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/0a78d5d5 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/0a78d5d5 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/0a78d5d5 Branch: refs/heads/master Commit: 0a78d5d54f19f7ac11e6ab7b5fc023d37ada8fcd Parents: 5fbeb4b Author: Pepijn Noltes <[email protected]> Authored: Fri Nov 10 11:31:45 2017 +0100 Committer: Pepijn Noltes <[email protected]> Committed: Fri Nov 10 11:33:06 2017 +0100 ---------------------------------------------------------------------- cmake/cmake_celix/DeployPackaging.cmake | 8 ++++++-- dfi/private/src/dyn_interface.c | 2 +- documents/cmake_commands/readme.md | 10 ++++++---- examples/dm_example_cxx/CMakeLists.txt | 1 + 4 files changed, 14 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/celix/blob/0a78d5d5/cmake/cmake_celix/DeployPackaging.cmake ---------------------------------------------------------------------- diff --git a/cmake/cmake_celix/DeployPackaging.cmake b/cmake/cmake_celix/DeployPackaging.cmake index 2b21265..3f75d37 100644 --- a/cmake/cmake_celix/DeployPackaging.cmake +++ b/cmake/cmake_celix/DeployPackaging.cmake @@ -34,7 +34,7 @@ function(add_celix_container) list(GET ARGN 0 CONTAINER_TARGET) list(REMOVE_AT ARGN 0) - set(OPTIONS COPY) + set(OPTIONS COPY CXX) set(ONE_VAL_ARGS GROUP NAME LAUNCHER DIR) set(MULTI_VAL_ARGS BUNDLES PROPERTIES) cmake_parse_arguments(CONTAINER "${OPTIONS}" "${ONE_VAL_ARGS}" "${MULTI_VAL_ARGS}" ${ARGN}) @@ -66,7 +66,11 @@ function(add_celix_container) set(CONTAINER_PROPS "${CONTAINER_LOC}/config.properties") set(CONTAINER_ECLIPSE_LAUNCHER "${CONTAINER_LOC}/${CONTAINER_NAME}.launch") - set(LAUNCHER_SRC "${CMAKE_CURRENT_BINARY_DIR}/${CONTAINER_TARGET}.launcher.c") + if (CONTAINER_CXX) + set(LAUNCHER_SRC "${CMAKE_CURRENT_BINARY_DIR}/${CONTAINER_TARGET}.launcher.cc") + else() + set(LAUNCHER_SRC "${CMAKE_CURRENT_BINARY_DIR}/${CONTAINER_TARGET}.launcher.c") + endif() add_custom_command(OUTPUT ${LAUNCHER_SRC} COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CELIX_CMAKE_DIRECTORY}/cmake_celix/main.c.in ${LAUNCHER_SRC} http://git-wip-us.apache.org/repos/asf/celix/blob/0a78d5d5/dfi/private/src/dyn_interface.c ---------------------------------------------------------------------- diff --git a/dfi/private/src/dyn_interface.c b/dfi/private/src/dyn_interface.c index cbd675b..63aafac 100644 --- a/dfi/private/src/dyn_interface.c +++ b/dfi/private/src/dyn_interface.c @@ -288,7 +288,7 @@ static int dynInterface_parseMethods(dyn_interface_type *intf, FILE *stream) { ungetc(peek, stream); char *id; - status = dynCommon_parseNameAlsoAccept(stream, "();[{}/", &id); + status = dynCommon_parseNameAlsoAccept(stream, ".();[{}/", &id); if (status == OK) { status = dynCommon_eatChar(stream, '='); http://git-wip-us.apache.org/repos/asf/celix/blob/0a78d5d5/documents/cmake_commands/readme.md ---------------------------------------------------------------------- diff --git a/documents/cmake_commands/readme.md b/documents/cmake_commands/readme.md index 87eb56f..1287299 100644 --- a/documents/cmake_commands/readme.md +++ b/documents/cmake_commands/readme.md @@ -150,14 +150,15 @@ install_bundle(<bundle_target> # Deployments ## add_deploy -Add a deployment, consisting out of a selection of bundles, for the project. +Add a deployment, consisting out of a selection of bundles and a simple Celix launcher. Deployments can be used to run/test a selection of bundles in the celix framework. A deployment can be found in `<cmake_build_dir>/deploy[/<group_name>]/<deploy_name>`. -Use the run.sh to run the deployments. +Use the `<deploy_target_name>` executable to run the deployments. ```CMake add_deploy(<deploy_target_name> [COPY] + [CXX] [GROUP group_name] [NAME deploy_name] [LAUNCHER launcher] @@ -176,7 +177,8 @@ If the bundle target is never added CMake will give an error: $<TARGET_PROPERTY:foo,BUNDLE_FILE> ``` -- If COPY is provided the selected bundles will be copied in a bundles dir and the generated config.properties will use relative paths to the bundle locations. Default bundles will not be copied and the generated config.properties will use absolute references to the bundle locations. +- If the COPY option is provided the selected bundles will be copied in a bundles dir and the generated config.properties will use relative paths to the bundle locations. Default bundles will not be copied and the generated config.properties will use absolute references to the bundle locations. +- If CXX option is provided the deploy launcher will be build as C++ executable and as result be linked with the required C++ libraries of the used compiler - If GROUP is provided the deployment will be grouped in the provided group name. - If NAME is provided that name will be used for the deployment dir. Default the deploy target name will be used. - If LAUNCHER is provided that path or target will be used as launcher executable for the deployment. If no LAUNCHER is not provided the celix executable will be used. @@ -290,4 +292,4 @@ TODO TODO ## docker_instructions -TODO \ No newline at end of file +TODO http://git-wip-us.apache.org/repos/asf/celix/blob/0a78d5d5/examples/dm_example_cxx/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/examples/dm_example_cxx/CMakeLists.txt b/examples/dm_example_cxx/CMakeLists.txt index 3c6ee42..9572142 100644 --- a/examples/dm_example_cxx/CMakeLists.txt +++ b/examples/dm_example_cxx/CMakeLists.txt @@ -33,6 +33,7 @@ if (BUILD_DEPENDENCY_MANAGER_CXX) add_deploy("dm_example_cxx" COPY + CXX BUNDLES shell shell_tui
