CELIX-379: Added LAUNCHER option to add_deploy command

Project: http://git-wip-us.apache.org/repos/asf/celix/repo
Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/fc96bc5e
Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/fc96bc5e
Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/fc96bc5e

Branch: refs/heads/release/celix-2.0.0
Commit: fc96bc5ef42e83b6c7bb23dbdda9f1b647c24ffb
Parents: ab63081
Author: Erjan Altena <erjan.alt...@nl.thalesgroup.com>
Authored: Mon Oct 10 16:19:05 2016 +0200
Committer: Erjan Altena <erjan.alt...@nl.thalesgroup.com>
Committed: Mon Oct 10 16:19:05 2016 +0200

----------------------------------------------------------------------
 cmake/cmake_celix/Packaging.cmake | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/fc96bc5e/cmake/cmake_celix/Packaging.cmake
----------------------------------------------------------------------
diff --git a/cmake/cmake_celix/Packaging.cmake 
b/cmake/cmake_celix/Packaging.cmake
index eeb0a39..a2a969b 100644
--- a/cmake/cmake_celix/Packaging.cmake
+++ b/cmake/cmake_celix/Packaging.cmake
@@ -456,7 +456,7 @@ function(add_deploy)
     list(REMOVE_AT ARGN 0)
 
     set(OPTIONS COPY)
-    set(ONE_VAL_ARGS GROUP NAME)
+    set(ONE_VAL_ARGS GROUP NAME LAUNCHER)
     set(MULTI_VAL_ARGS BUNDLES PROPERTIES)
     cmake_parse_arguments(DEPLOY "${OPTIONS}" "${ONE_VAL_ARGS}" 
"${MULTI_VAL_ARGS}" ${ARGN})
 
@@ -556,7 +556,15 @@ 
$<JOIN:$<TARGET_PROPERTY:${DEPLOY_TARGET},DEPLOY_PROPERTIES>,
         OUTPUT ${DEPLOY_RELEASE_SH}
         CONTENT ${RELEASE_CONTENT}
     )
-    set(RUN_CONTENT "${RELEASE_CONTENT}\ncelix \$@")
+    if(DEPLOY_LAUNCHER)
+        if(TARGET ${DEPLOY_LAUNCHER})
+            set(RUN_CONTENT 
"${RELEASE_CONTENT}\n$<TARGET_FILE:${DEPLOY_LAUNCHER}> \$@\n")
+        else() 
+            set(RUN_CONTENT "${RELEASE_CONTENT}\n${DEPLOY_LAUNCHER} \$@\n")
+        endif()
+    else()
+        set(RUN_CONTENT "${RELEASE_CONTENT}\ncelix \$@\n")
+    endif()
     file(GENERATE
         OUTPUT ${DEPLOY_RUN_SH}
         CONTENT ${RUN_CONTENT}

Reply via email to