celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pnol...@apache.org
Subject [42/42] celix git commit: CELIX-335: Fix run.sh generated. Generation now also works for celix based projects.
Date Fri, 05 Feb 2016 11:01:01 GMT
CELIX-335: Fix run.sh generated. Generation now also works for celix based projects.


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

Branch: refs/heads/develop
Commit: b19a8f6beda1054bf0fac831124b8ff6519762f2
Parents: da797a0
Author: Pepijn Noltes <pepijnnoltes@gmail.com>
Authored: Fri Feb 5 11:30:46 2016 +0100
Committer: Pepijn Noltes <pepijnnoltes@gmail.com>
Committed: Fri Feb 5 11:30:46 2016 +0100

----------------------------------------------------------------------
 cmake/FindCELIX.cmake             | 23 +++++++++++++++++------
 cmake/cmake_celix/Packaging.cmake | 33 +++++++++++++++++++--------------
 2 files changed, 36 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/b19a8f6b/cmake/FindCELIX.cmake
----------------------------------------------------------------------
diff --git a/cmake/FindCELIX.cmake b/cmake/FindCELIX.cmake
index 9f91e5a..b2789df 100644
--- a/cmake/FindCELIX.cmake
+++ b/cmake/FindCELIX.cmake
@@ -31,28 +31,39 @@ set(CELIX_DIR_FROM_FINDCELIX "${CMAKE_CURRENT_LIST_DIR}/../../../..")
 
 find_path(CELIX_INCLUDE_DIR celix_errno.h
 		PATHS ${CELIX_DIR_FROM_FINDCELIX} $ENV{CELIX_DIR} ${CELIX_DIR} /usr /usr/local
-          	PATH_SUFFIXES include include/celix)
+          	PATH_SUFFIXES include include/celix
+)
 
 find_library(CELIX_FRAMEWORK_LIBRARY NAMES celix_framework
              	PATHS ${CELIX_DIR_FROM_FINDCELIX} $ENV{CELIX_DIR} ${CELIX_DIR} /usr /usr/local
-             	PATH_SUFFIXES lib lib64)
+             	PATH_SUFFIXES lib lib64
+)
              
 find_library(CELIX_UTILS_LIBRARY NAMES celix_utils
 		PATHS ${CELIX_DIR_FROM_FINDCELIX} $ENV{CELIX_DIR} ${CELIX_DIR} /usr /usr/local
-		PATH_SUFFIXES lib lib64)
+		PATH_SUFFIXES lib lib64
+)
+
+find_library(CELIX_DFI_LIBRARY NAMES celix_dfi
+		PATHS ${CELIX_DIR_FROM_FINDCELIX} $ENV{CELIX_DIR} ${CELIX_DIR} /usr /usr/local
+		PATH_SUFFIXES lib lib64
+)
 
 find_program(CELIX_LAUNCHER NAMES celix
 		PATHS ${CELIX_DIR_FROM_FINDCELIX} $ENV{CELIX_DIR} ${CELIX_DIR} /usr /usr/local
-		PATH_SUFFIXES bin)
+		PATH_SUFFIXES bin
+)
 
 find_file(CELIX_CMAKECELIX_FILE CMakeCelix.cmake
              	PATHS ${CELIX_DIR_FROM_FINDCELIX} $ENV{CELIX_DIR} ${CELIX_DIR} /usr /usr/local
-             	PATH_SUFFIXES share/celix/cmake/modules)
+             	PATH_SUFFIXES share/celix/cmake/modules
+)
 
 #NOTE assuming shell.zip is always installed.
 find_path(CELIX_BUNDLES_DIR shell.zip
 		PATHS ${CELIX_DIR_FROM_FINDCELIX} $ENV{CELIX_DIR} ${CELIX_DIR} /usr /usr/local
-          	PATH_SUFFIXES share/celix/bundles)
+          	PATH_SUFFIXES share/celix/bundles
+)
 	
 
 

http://git-wip-us.apache.org/repos/asf/celix/blob/b19a8f6b/cmake/cmake_celix/Packaging.cmake
----------------------------------------------------------------------
diff --git a/cmake/cmake_celix/Packaging.cmake b/cmake/cmake_celix/Packaging.cmake
index ccdc33c..0521261 100644
--- a/cmake/cmake_celix/Packaging.cmake
+++ b/cmake/cmake_celix/Packaging.cmake
@@ -496,23 +496,28 @@ $<JOIN:$<TARGET_PROPERTY:${DEPLOY_TARGET},DEPLOY_PROPERTIES>,
     set(PATHS "${CMAKE_BIN_DIRECTORY}/framework:${CMAKE_BIN_DIRECTORY}/utils:${CMAKE_BIN_DIRECTORY}/dfi")
     configure_file("${CELIX_CMAKE_DIRECTORY}/cmake_celix/RunConfig.in"  "${DEPLOY_LOCATION}/${DEPLOY_NAME}")
 
+    if(APPLE)
+        set(LIB_PATH_NAME "DYLD_LIBRARY_PATH")
+    else()
+        set(LIB_PATH_NAME "LD_LIBRARY_PATH")
+    endif()
 
-    if(APPLE) 
-        file(GENERATE
-            OUTPUT ${DEPLOY_LOCATION}/run.sh
-            CONTENT "export DYLD_LIBRARY_PATH=$<TARGET_FILE_DIR:celix_framework>:$<TARGET_FILE_DIR:celix_utils>:$<TARGET_FILE_DIR:celix_dfi>:\${DYLD_LIBRARY_PATH}
-$<TARGET_FILE:celix> $@
-"
-    )
-    else() 
-        file(GENERATE
-            OUTPUT ${DEPLOY_LOCATION}/run.sh
-            CONTENT "export LD_LIBRARY_PATH=$<TARGET_FILE_DIR:celix_framework>:$<TARGET_FILE_DIR:celix_utils>:$<TARGET_FILE_DIR:celix_dfi>:\${LD_LIBRARY_PATH}
-$<TARGET_FILE:celix> $@
-"
-    )
+    if (EXISTS ${CELIX_FRAMEWORK_LIBRARY}) 
+        #Celix Based Project
+        get_filename_component(CELIX_LIB_DIR ${CELIX_FRAMEWORK_LIBRARY} DIRECTORY) #Note
assuming all celix libs are in the same dir
+        set(RUN_CONTENT "export ${LIB_PATH_NAME}=${CELIX_LIB_DIR}:\${${LIB_PATH_NAME}}
+${CELIX_LAUNCHER} $@")
+    else()
+        #Celix Main Project
+        set(RUN_CONTENT "export ${LIB_PATH_NAME}=$<TARGET_FILE_DIR:celix_framework>:$<TARGET_FILE_DIR:celix_utils>:$<TARGET_FILE_DIR:celix_dfi>:\${${LIB_PATH_NAME}}
+$<TARGET_FILE:celix> $@")
     endif()
 
+    file(GENERATE
+        OUTPUT ${DEPLOY_LOCATION}/run.sh
+        CONTENT ${RUN_CONTENT}
+    )
+
     #TODO eclipse launcher file
     #####
 


Mime
View raw message