You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@celix.apache.org by pn...@apache.org on 2017/02/22 19:48:01 UTC

celix git commit: CELIX-400: Adds ADD_TO_MANIFEST to the bundle_libs CMake command. This can be used to fine tune the use of the Private-Library manifest statement.

Repository: celix
Updated Branches:
  refs/heads/develop ef3ef52a8 -> 8670cae69


CELIX-400: Adds ADD_TO_MANIFEST to the bundle_libs CMake command. This can be used to fine tune the use of the Private-Library manifest statement.


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

Branch: refs/heads/develop
Commit: 8670cae695922930d3e8e6001e46ab9fe45b8761
Parents: ef3ef52
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Wed Feb 22 20:50:39 2017 +0100
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Wed Feb 22 20:50:39 2017 +0100

----------------------------------------------------------------------
 cmake/cmake_celix/BundlePackaging.cmake | 26 +++++++++++++++++---------
 1 file changed, 17 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/8670cae6/cmake/cmake_celix/BundlePackaging.cmake
----------------------------------------------------------------------
diff --git a/cmake/cmake_celix/BundlePackaging.cmake b/cmake/cmake_celix/BundlePackaging.cmake
index a9c605b..ded1ca5 100644
--- a/cmake/cmake_celix/BundlePackaging.cmake
+++ b/cmake/cmake_celix/BundlePackaging.cmake
@@ -223,7 +223,7 @@ function(add_bundle)
     ################################
 
     if(BUNDLE_SOURCES) 
-        bundle_private_libs(${BUNDLE_TARGET_NAME} ${BUNDLE_TARGET_NAME})
+        bundle_libs(${BUNDLE_TARGET_NAME} "PRIVATE" TRUE ${BUNDLE_TARGET_NAME})
         set_target_properties(${BUNDLE_TARGET_NAME} PROPERTIES "BUNDLE_ACTIVATOR" "$<TARGET_SONAME_FILE_NAME:${BUNDLE_TARGET_NAME}>")
         set_target_properties(${BUNDLE_TARGET_NAME} PROPERTIES "BUILD_WITH_INSTALL_RPATH" true)
 
@@ -235,7 +235,7 @@ function(add_bundle)
     elseif(BUNDLE_NO_ACTIVATOR)
         #do nothing
     else() #ACTIVATOR 
-        bundle_private_libs(${BUNDLE_TARGET_NAME} ${BUNDLE_ACTIVATOR})
+        bundle_libs(${BUNDLE_TARGET_NAME} "PRIVATE" TRUE ${BUNDLE_ACTIVATOR})
         
         if(TARGET ${BUNDLE_ACTIVATOR})
             set_target_properties(${BUNDLE_TARGET_NAME} PROPERTIES "BUNDLE_ACTIVATOR" "$<TARGET_SONAME_FILE_NAME:${BUNDLE_ACTIVATOR}>")
@@ -263,18 +263,19 @@ endfunction()
 function(bundle_export_libs)
     list(GET ARGN 0 BUNDLE)
     list(REMOVE_AT ARGN 0)
-    bundle_libs(${BUNDLE} "EXPORT" ${ARGN})
+    bundle_libs(${BUNDLE} "EXPORT" TRUE ${ARGN})
 endfunction()
 
 function(bundle_private_libs)
     list(GET ARGN 0 BUNDLE)
     list(REMOVE_AT ARGN 0)
-    bundle_libs(${BUNDLE} "PRIVATE" ${ARGN})
+    bundle_libs(${BUNDLE} "PRIVATE" FALSE ${ARGN})
 endfunction()
 
 function(bundle_libs)
     #0 is bundle TARGET
-    #1 is type (PRIVATE,EXPORT
+    #1 is TYPE, e.g PRIVATE,EXPORT or IMPORT
+    #2 is ADD_TO_MANIFEST 
     #2..n is libs
     list(GET ARGN 0 BUNDLE)
     list(REMOVE_AT ARGN 0)
@@ -282,6 +283,9 @@ function(bundle_libs)
     list(GET ARGN 0 TYPE)
     list(REMOVE_AT ARGN 0)
 
+    list(GET ARGN 0 ADD_TO_MANIFEST)
+    list(REMOVE_AT ARGN 0)
+
     #check if arg 0 is corrent
     check_bundle(${BUNDLE})
     get_target_property(BUNDLE_DIR ${BUNDLE} "BUNDLE_CONTENT_DIR")
@@ -298,7 +302,9 @@ function(bundle_libs)
             add_custom_command(OUTPUT ${OUT} 
                 COMMAND ${CMAKE_COMMAND} -E copy_if_different ${LIB} ${OUT} 
             )
-            list(APPEND LIBS ${LIB_NAME})
+            if (ADD_TO_MANIFEST)
+                list(APPEND LIBS ${LIB_NAME})
+            endif()
             list(APPEND DEPS ${OUT}) 
         else()
             #Assuming target
@@ -310,8 +316,10 @@ function(bundle_libs)
                 COMMAND ${CMAKE_COMMAND} -E copy_if_different "$<TARGET_FILE:${LIB}>" "${BUNDLE_DIR}/$<TARGET_SONAME_FILE_NAME:${LIB}>"
                 DEPENDS ${LIB}
             )
-            list(APPEND DEPS "${OUT}") #NOTE depending on ${OUT} not on $<TARGET_FILE:${LIB}>.
-            list(APPEND LIBS "$<TARGET_SONAME_FILE_NAME:${LIB}>")
+            if (ADD_TO_MANIFEST)
+                list(APPEND LIBS "$<TARGET_SONAME_FILE_NAME:${LIB}>")
+            endif()
+                list(APPEND DEPS "${OUT}") #NOTE depending on ${OUT} not on $<TARGET_FILE:${LIB}>.
         endif()
 
         get_target_property(IS_LIB ${BUNDLE} "BUNDLE_TARGET_IS_LIB")
@@ -432,4 +440,4 @@ function(install_bundle)
         install (FILES ${INSTALL_RESOURCES} DESTINATION share/${INSTALL_PROJECT_NAME}/${INSTALL_BUNDLE_NAME} COMPONENT ${BUNDLE})
     endif()
 
-endfunction()
\ No newline at end of file
+endfunction()