celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pnol...@apache.org
Subject svn commit: r1489103 - in /incubator/celix/trunk/cmake: Packaging.cmake modules/FindCELIX.cmake
Date Mon, 03 Jun 2013 18:56:15 GMT
Author: pnoltes
Date: Mon Jun  3 18:56:14 2013
New Revision: 1489103

URL: http://svn.apache.org/r1489103
Log:
CELIX-63: A bundle project can now be created with use of the cmake directory of the celix
project. 

Added:
    incubator/celix/trunk/cmake/modules/FindCELIX.cmake   (with props)
Modified:
    incubator/celix/trunk/cmake/Packaging.cmake

Modified: incubator/celix/trunk/cmake/Packaging.cmake
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/cmake/Packaging.cmake?rev=1489103&r1=1489102&r2=1489103&view=diff
==============================================================================
--- incubator/celix/trunk/cmake/Packaging.cmake (original)
+++ incubator/celix/trunk/cmake/Packaging.cmake Mon Jun  3 18:56:14 2013
@@ -147,8 +147,11 @@ MACRO(deploy)
 	    SET(BUNDLES "${BUNDLES} bundles/${BUNDLE}.zip")
 	    SET(DEPS ${DEPS};${CMAKE_CURRENT_BINARY_DIR}/deploy/${DEPLOY_NAME}/bundles/${BUNDLE}.zip)
 	ENDFOREACH(BUNDLE)
+	IF(NOT(CELIX_FOUND)) #celix project
+		set(DEPS ${DEPS};celix)
+	ENDIF()
     ADD_CUSTOM_TARGET(${__deployTarget} 
-    	DEPENDS ${DEPS} celix
+    	DEPENDS ${DEPS}
     	COMMENT "Deploy target ${DEPLOY_NAME}")
     ADD_DEPENDENCIES(deploy ${__deployTarget})
     
@@ -158,9 +161,16 @@ MACRO(deploy)
 	CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/cmake/config.properties.in ${CMAKE_CURRENT_BINARY_DIR}/deploy/${DEPLOY_NAME}/config.properties
@ONLY)
 	
 	IF(UNIX)
-		set(FW_PATH ${CMAKE_BINARY_DIR}/framework)
-		set(UTILS_PATH ${CMAKE_BINARY_DIR}/utils)
-		set(LAUNCHER ${CMAKE_BINARY_DIR}/launcher/celix)
+		if(CELIX_FOUND)
+			GET_FILENAME_COMPONENT(FW_PATH ${CELIX_FRAMEWORK_LIBRARY} PATH)
+			GET_FILENAME_COMPONENT(UTILS_PATH ${CELIX_UTILS_LIBRARY} PATH)
+			set(LAUNCHER ${CELIX_LAUNCHER})
+		ELSE(CELIX_FOUND)
+			set(FW_PATH ${CMAKE_BINARY_DIR}/framework)
+			set(UTILS_PATH ${CMAKE_BINARY_DIR}/utils)
+			set(LAUNCHER ${CMAKE_BINARY_DIR}/launcher/celix)
+		ENDIF(CELIX_FOUND)
+		
 		
 		IF(UNIX)
 		  IF(APPLE)
@@ -192,8 +202,14 @@ MACRO(deploy)
 		GET_FILENAME_COMPONENT(aprutil_path ${APRUTIL_LIBRARY} PATH)
 		GET_FILENAME_COMPONENT(zlib_path ${ZLIB_LIBRARY} PATH)
 		GET_FILENAME_COMPONENT(curl_path ${CURL_LIBRARY} PATH)
-		SET(celixutils_path "${PROJECT_BINARY_DIR}/utils/${CMAKE_BUILD_TYPE}")
-		SET(celixframework_path "${PROJECT_BINARY_DIR}/framework/${CMAKE_BUILD_TYPE}")
+		
+		IF(CELIX_FOUND)
+			SET(celixutils_path "${CELIX_FRAMEWORK_LIBRARY}/utils/${CMAKE_BUILD_TYPE}")
+			SET(celixframework_path "${CELIX_FRAMEWORK_LIBRARY}/framework/${CMAKE_BUILD_TYPE}")
+		ELSE(CELIX_FOUND)
+			SET(celixutils_path "${PROJECT_BINARY_DIR}/utils/${CMAKE_BUILD_TYPE}")
+			SET(celixframework_path "${PROJECT_BINARY_DIR}/framework/${CMAKE_BUILD_TYPE}")
+		ENDIF(CELIX_FOUND)
 		
 		SET(PATH "%PATH%;${apr_path};${aprutil_path};${zlib_path};${curl_path};${celixutils_path};${celixframework_path}")
 		

Added: incubator/celix/trunk/cmake/modules/FindCELIX.cmake
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/cmake/modules/FindCELIX.cmake?rev=1489103&view=auto
==============================================================================
--- incubator/celix/trunk/cmake/modules/FindCELIX.cmake (added)
+++ incubator/celix/trunk/cmake/modules/FindCELIX.cmake Mon Jun  3 18:56:14 2013
@@ -0,0 +1,52 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+
+# - Try to find Celix
+# 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_LIBRARY_PATHS - The libraries paths needed for execution
+#  CELIX_DEFINITIONS - Compiler switches required for using Apache Celix
+
+find_path(CELIX_INCLUDE_DIR celix_errno.h
+		PATHS $ENV{CELIX_DIR} /usr /usr/local
+          	PATH_SUFFIXES include include/celix)
+
+find_library(CELIX_FRAMEWORK_LIBRARY NAMES celix_framework
+             	PATHS $ENV{CELIX_DIR} /usr /usr/local
+             	PATH_SUFFIXES lib lib64)
+             
+find_library(CELIX_UTILS_LIBRARY NAMES celix_utils
+		PATHS $ENV{CELIX_DIR} /usr /usr/local
+		PATH_SUFFIXES lib lib64)
+
+find_program(CELIX_LAUNCHER NAMES celix
+		PATHS $ENV{CELIX_DIR} /usr /usr/local
+		PATH_SUFFIXES bin)
+
+set(CELIX_LIBRARIES ${CELIX_FRAMEWORK_LIBRARY} ${CELIX_UTILS_LIBRARY})
+set(CELIX_INCLUDE_DIRS ${CELIX_INCLUDE_DIR})
+
+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)

Propchange: incubator/celix/trunk/cmake/modules/FindCELIX.cmake
------------------------------------------------------------------------------
    svn:executable = *



Mime
View raw message