celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pnol...@apache.org
Subject svn commit: r1623876 - in /celix/trunk/cmake: FindCELIX.cmake cmake_celix/Packaging.cmake
Date Tue, 09 Sep 2014 20:03:56 GMT
Author: pnoltes
Date: Tue Sep  9 20:03:56 2014
New Revision: 1623876

URL: http://svn.apache.org/r1623876
Log:
CELIX-144: Changed FindCelix, additional include(..) not needed anymore. assuming celix binaries/headers
are findable relative form FindCELIX.cmake. Also exports CELIX_BUNDLES_DIR for use in the
deploy.cmake files. Packinging now regonizes bunles with a full path (e.g. using CELIX_BUNDLES_DIR)
and add those bundles to the deployment.

Modified:
    celix/trunk/cmake/FindCELIX.cmake
    celix/trunk/cmake/cmake_celix/Packaging.cmake

Modified: celix/trunk/cmake/FindCELIX.cmake
URL: http://svn.apache.org/viewvc/celix/trunk/cmake/FindCELIX.cmake?rev=1623876&r1=1623875&r2=1623876&view=diff
==============================================================================
--- celix/trunk/cmake/FindCELIX.cmake (original)
+++ celix/trunk/cmake/FindCELIX.cmake Tue Sep  9 20:03:56 2014
@@ -16,39 +16,55 @@
 # under the License.
 
 
-# - Try to find Celix
+# - Try to find Celix define the variables for the binaries/headers and include 
+#   the Celix cmake modules needed to build bundles
+#
 # Once done this will define
 #  CELIX_FOUND - System has Apache Celix
 #  CELIX_INCLUDE_DIRS - The Apache Celix include directories
 #  CELIX_LIBRARIES - The libraries needed to use Apache Celix
-##
 #  CELIX_LAUNCHER - The path to the celix launcher
+#  CELIX_BUNDLES_DIR - The path where the Celix provided bundles are installed
+
+set(CELIX_DIR_FROM_FINDCELIX "${CMAKE_CURRENT_LIST_DIR}/../../../..")
+
 
 find_path(CELIX_INCLUDE_DIR celix_errno.h
-		PATHS $ENV{CELIX_DIR} ${CELIX_DIR} /usr /usr/local
+		PATHS ${CELIX_DIR_FROM_FINDCELIX} $ENV{CELIX_DIR} ${CELIX_DIR} /usr /usr/local
           	PATH_SUFFIXES include include/celix)
 
 find_library(CELIX_FRAMEWORK_LIBRARY NAMES celix_framework
-             	PATHS $ENV{CELIX_DIR} ${CELIX_DIR} /usr /usr/local
+             	PATHS ${CELIX_DIR_FROM_FINDCELIX} $ENV{CELIX_DIR} ${CELIX_DIR} /usr /usr/local
              	PATH_SUFFIXES lib lib64)
              
 find_library(CELIX_UTILS_LIBRARY NAMES celix_utils
-		PATHS $ENV{CELIX_DIR} ${CELIX_DIR} /usr /usr/local
+		PATHS ${CELIX_DIR_FROM_FINDCELIX} $ENV{CELIX_DIR} ${CELIX_DIR} /usr /usr/local
 		PATH_SUFFIXES lib lib64)
 
 find_program(CELIX_LAUNCHER NAMES celix
-		PATHS $ENV{CELIX_DIR} ${CELIX_DIR} /usr /usr/local
+		PATHS ${CELIX_DIR_FROM_FINDCELIX} $ENV{CELIX_DIR} ${CELIX_DIR} /usr /usr/local
 		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)
+
+#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)
+	
+
 
 include(FindPackageHandleStandardArgs)
 # handle the QUIETLY and REQUIRED arguments and set CELIX_FOUND to TRUE
 # if all listed variables are TRUE
 find_package_handle_standard_args(CELIX  DEFAULT_MSG
-                                  CELIX_FRAMEWORK_LIBRARY CELIX_UTILS_LIBRARY CELIX_INCLUDE_DIR
CELIX_LAUNCHER)
-mark_as_advanced(CELIX_INCLUDE_DIR CELIX_FRAMEWORK_LIBRARY CELIX_UTILS_LIBRARY CELIX_LAUNCHER)
+                                  CELIX_FRAMEWORK_LIBRARY CELIX_UTILS_LIBRARY CELIX_INCLUDE_DIR
CELIX_LAUNCHER CELIX_CMAKECELIX_FILE) 
+mark_as_advanced(CELIX_INCLUDE_DIR CELIX_FRAMEWORK_LIBRARY CELIX_UTILS_LIBRARY CELIX_LAUNCHER
CELIX_CMAKECELIX_FILE)
 
 if(CELIX_FOUND)
 	set(CELIX_LIBRARIES ${CELIX_FRAMEWORK_LIBRARY} ${CELIX_UTILS_LIBRARY})
 	set(CELIX_INCLUDE_DIRS ${CELIX_INCLUDE_DIR})
+	include(${CELIX_CMAKECELIX_FILE})
 endif()

Modified: celix/trunk/cmake/cmake_celix/Packaging.cmake
URL: http://svn.apache.org/viewvc/celix/trunk/cmake/cmake_celix/Packaging.cmake?rev=1623876&r1=1623875&r2=1623876&view=diff
==============================================================================
--- celix/trunk/cmake/cmake_celix/Packaging.cmake (original)
+++ celix/trunk/cmake/cmake_celix/Packaging.cmake Tue Sep  9 20:03:56 2014
@@ -336,15 +336,25 @@ MACRO(deploy)
 	
 	FOREACH(BUNDLE ${DEPLOY_BUNDLES})
 		SET(DEP_NAME ${DEPLOY_NAME}_${BUNDLE}) 
-		get_property(bundle_file TARGET ${BUNDLE} PROPERTY BUNDLE)
-		add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/deploy/${DEPLOY_NAME}/bundles/${BUNDLE}.zip
-      		COMMAND ${CMAKE_COMMAND} -E copy ${bundle_file} 
-      			${CMAKE_CURRENT_BINARY_DIR}/deploy/${DEPLOY_NAME}/bundles/${BUNDLE}.zip
-  			DEPENDS ${BUNDLE}
-  			COMMENT "Deploying ${BUNDLE} to ${DEPLOY_NAME}"
-      	)
-	    SET(BUNDLES "${BUNDLES} bundles/${BUNDLE}.zip")
-	    SET(DEPS ${DEPS};${CMAKE_CURRENT_BINARY_DIR}/deploy/${DEPLOY_NAME}/bundles/${BUNDLE}.zip)
+		IF(EXISTS ${BUNDLE})  #it is a full path not a bundle name (e.g. a target)
+			get_filename_component(BUNDLE_NAME ${BUNDLE} NAME_WE)	
+			add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/deploy/${DEPLOY_NAME}/bundles/${BUNDLE_NAME}.zip
+				COMMAND ${CMAKE_COMMAND} -E copy ${BUNDLE} 
+				${CMAKE_CURRENT_BINARY_DIR}/deploy/${DEPLOY_NAME}/bundles/${BUNDLE_NAME}.zip
+				COMMENT "Deploying ${BUNDLE} to ${DEPLOY_NAME}"
+			)
+		ELSE()
+			set(BUNDLE_NAME ${BUNDLE})
+			get_property(bundle_file TARGET ${BUNDLE} PROPERTY BUNDLE)
+			add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/deploy/${DEPLOY_NAME}/bundles/${BUNDLE}.zip
+				COMMAND ${CMAKE_COMMAND} -E copy ${bundle_file} 
+				${CMAKE_CURRENT_BINARY_DIR}/deploy/${DEPLOY_NAME}/bundles/${BUNDLE}.zip
+				DEPENDS ${BUNDLE}
+				COMMENT "Deploying ${BUNDLE} to ${DEPLOY_NAME}"
+			)
+		ENDIF()
+	    	SET(BUNDLES "${BUNDLES} bundles/${BUNDLE_NAME}.zip")
+	    	SET(DEPS ${DEPS};${CMAKE_CURRENT_BINARY_DIR}/deploy/${DEPLOY_NAME}/bundles/${BUNDLE_NAME}.zip)
 	ENDFOREACH(BUNDLE)
 
 	FOREACH(BUNDLE ${DEPLOY_DRIVERS})



Mime
View raw message