Author: abroekhuis
Date: Tue Oct 1 12:47:43 2013
New Revision: 1528071
URL: http://svn.apache.org/r1528071
Log:
CELIX-54: Replaced windows line endings with linux.
Modified:
incubator/celix/trunk/cmake/Packaging.cmake
incubator/celix/trunk/doap/doap_Celix.rdf
incubator/celix/trunk/examples/CMakeLists.txt
incubator/celix/trunk/examples/mongoose/private/include/mongoose.h
incubator/celix/trunk/examples/mongoose/private/src/mongoose.c
incubator/celix/trunk/examples/osgi-in-action/chapter04-correct-lookup/private/src/activator.c
incubator/celix/trunk/framework/CMakeLists.txt
incubator/celix/trunk/framework/public/include/celixbool.h
incubator/celix/trunk/framework/public/include/framework_exports.h
incubator/celix/trunk/utils/CMakeLists.txt
Modified: incubator/celix/trunk/cmake/Packaging.cmake
URL:
http://svn.apache.org/viewvc/incubator/celix/trunk/cmake/Packaging.cmake?rev=1528071&r1=1528070&r2=1528071&view=diff
==============================================================================
--- incubator/celix/trunk/cmake/Packaging.cmake (original)
+++ incubator/celix/trunk/cmake/Packaging.cmake Tue Oct 1 12:47:43 2013
@@ -1,349 +1,349 @@
-# 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.
-
-GET_FILENAME_COMPONENT(__cmake_path ${CMAKE_COMMAND} PATH)
-FIND_PROGRAM(CPACK_COMMAND cpack ${__cmake_path})
-MESSAGE(STATUS "Found CPack at: ${CPACK_COMMAND}")
-IF(NOT CPACK_COMMAND)
- MESSAGE(FATAL_ERROR "Need CPack!")
-ENDIF(NOT CPACK_COMMAND)
-
-include(CPackComponent)
-
-macro( CELIX_ADD_COMPONENT_GROUP _group )
- set( _readVariable )
- set( _parentGroup )
- foreach( _i ${ARGN} )
- if( _readVariable )
- set( ${_readVariable} "${_i}" )
- break()
- else( _readVariable )
- if( "${_i}" STREQUAL PARENT_GROUP )
- set( _readVariable _parentGroup )
- endif( "${_i}" STREQUAL PARENT_GROUP )
- endif( _readVariable )
- endforeach( _i ${ARGN} )
-
- cpack_add_component_group( ${_group} ${ARGN} )
- add_custom_target( install-${_group} )
- if( _parentGroup )
- add_dependencies( install-${_parentGroup} install-${_group} )
- endif( _parentGroup )
-endmacro( CELIX_ADD_COMPONENT_GROUP _group )
-
-macro( CELIX_ADD_COMPONENT _component )
- set( _readVariable )
- set( _group )
- foreach( _i ${ARGN} )
- if( _readVariable )
- set( ${_readVariable} "${_i}" )
- break()
- else( _readVariable )
- if( "${_i}" STREQUAL GROUP )
- set( _readVariable _group )
- endif( "${_i}" STREQUAL GROUP )
- endif( _readVariable )
- endforeach( _i ${ARGN} )
-
- cpack_add_component( ${_component} ${ARGN} )
- add_custom_target( install-${_component}
- COMMAND ${CMAKE_COMMAND} -DCOMPONENT=${_component} -P
-"${CMAKE_BINARY_DIR}/cmake_install.cmake" )
- add_dependencies( install-${_group} install-${_component} )
-endmacro( CELIX_ADD_COMPONENT _component _group )
-
-find_program(JAR_COMMAND jar)
-if(JAR_COMMAND)
- message(STATUS "Using JAR to repack bundles, bundles can be used by
Apache ACE")
-else(JAR_COMMAND)
- message("No JAR support, generated bundles are not usable for Apache ACE")
-endif(JAR_COMMAND)
-
-SET(CPACK_GENERATOR "ZIP")
-
-celix_add_component_group(all)
-celix_add_component_group(bundles PARENT_GROUP all)
-
-MACRO(SET_HEADER header content)
- SET(INT_${header} "${content}")
- string(STRIP ${INT_${header}} INT_${header})
-ENDMACRO(SET_HEADER)
-
-MACRO(SET_HEADERS content)
- SET(INT_BUNDLE_EXTRAHEADER "${INT_BUNDLE_EXTRAHEADER}\n${content}")
- string(STRIP ${INT_BUNDLE_EXTRAHEADER} INT_BUNDLE_EXTRAHEADER)
-ENDMACRO(SET_HEADERS)
-
-MACRO(bundle)
- PARSE_ARGUMENTS(BUNDLE "SOURCES;FILES;DIRECTORIES;INSTALL_FILES" "INSTALL"
${ARGN})
- LIST(GET BUNDLE_DEFAULT_ARGS 0 INT_BUNDLE_NAME)
-
- add_library(${INT_BUNDLE_NAME} SHARED ${BUNDLE_SOURCES})
- set_property(TARGET ${INT_BUNDLE_NAME} PROPERTY BUNDLE
"${CMAKE_CURRENT_BINARY_DIR}/${INT_BUNDLE_NAME}.zip")
-
- if (NOT INT_BUNDLE_SYMBOLICNAME)
- set(INT_BUNDLE_SYMBOLICNAME ${INT_BUNDLE_NAME})
- endif (NOT INT_BUNDLE_SYMBOLICNAME)
- if (NOT INT_BUNDLE_VERSION)
- set(INT_BUNDLE_VERSION ${DEFAULT_VERSION})
- endif (NOT INT_BUNDLE_VERSION)
- if (NOT INT_BUNDLE_DESCRIPTION)
- set(INT_BUNDLE_DESCRIPTION "${INT_BUNDLE_SYMBOLICNAME} bundle")
- endif (NOT INT_BUNDLE_DESCRIPTION)
-
- set(INT_BUNDLE_NAME_INSTALL ${INT_BUNDLE_NAME}_install)
-
- SET(__bundleManifest ${CMAKE_CURRENT_BINARY_DIR}/MANIFEST.MF)
- CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/cmake/manifest.in ${__bundleManifest}
@ONLY)
- install (FILES ${__bundleManifest} DESTINATION ./META-INF COMPONENT
${INT_BUNDLE_NAME_INSTALL})
-
- install (TARGETS ${INT_BUNDLE_NAME} DESTINATION . COMPONENT
${INT_BUNDLE_NAME_INSTALL})
- if (BUNDLE_FILES)
- install (FILES ${BUNDLE_FILES} DESTINATION . COMPONENT
${INT_BUNDLE_NAME_INSTALL})
- endif(BUNDLE_FILES)
- if (BUNDLE_DIRECTORIES)
- install (DIRECTORY ${BUNDLE_DIRECTORIES} DESTINATION . COMPONENT
${INT_BUNDLE_NAME_INSTALL})
- endif(BUNDLE_DIRECTORIES)
-
- SET(__bundleConfig
${CMAKE_CURRENT_BINARY_DIR}/CPackConfig-${INT_BUNDLE_NAME}-bundle.cmake)
- SET(BUNDLE_BIN_DIR ${CMAKE_CURRENT_BINARY_DIR})
- CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/cmake/CPackConfig.in
${__bundleConfig} @ONLY)
-
- if(JAR_COMMAND)
- ADD_CUSTOM_COMMAND(TARGET ${INT_BUNDLE_NAME}
- POST_BUILD
- COMMAND ${CPACK_COMMAND} ARGS -C Debug --config
${__bundleConfig}
- COMMAND ${CMAKE_COMMAND} -E make_directory
${CMAKE_CURRENT_BINARY_DIR}/ziptojar
- COMMAND ${CMAKE_COMMAND} -E chdir
${CMAKE_CURRENT_BINARY_DIR}/ziptojar ${JAR_COMMAND} -xf
${CMAKE_CURRENT_BINARY_DIR}/${INT_BUNDLE_NAME}.zip
- COMMAND ${CMAKE_COMMAND} -E chdir
${CMAKE_CURRENT_BINARY_DIR}/ziptojar ${JAR_COMMAND} -cfm
${CMAKE_CURRENT_BINARY_DIR}/${INT_BUNDLE_NAME}.zip META-INF/MANIFEST.MF .
- COMMAND ${CMAKE_COMMAND} -E remove_directory
${CMAKE_CURRENT_BINARY_DIR}/ziptojar
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
- )
- else(JAR_COMMAND)
- ADD_CUSTOM_COMMAND(TARGET ${INT_BUNDLE_NAME}
- POST_BUILD
- COMMAND ${CPACK_COMMAND} ARGS -C Debug --config
${__bundleConfig}
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
- )
- endif(JAR_COMMAND)
-
- if (BUNDLE_INSTALL)
- CELIX_ADD_COMPONENT(${INT_BUNDLE_NAME}
- DISPLAY_NAME ${INT_BUNDLE_SYMBOLICNAME}
- DESCRIPTION ${INT_BUNDLE_DESCRIPTION}
- GROUP bundles
- )
- add_dependencies( install-${INT_BUNDLE_NAME} ${INT_BUNDLE_NAME} )
-
- if (BUNDLE_INSTALL_FILES)
- install (FILES ${BUNDLE_INSTALL_FILES} DESTINATION
include/celix/${INT_BUNDLE_NAME} COMPONENT ${INT_BUNDLE_NAME})
- endif(BUNDLE_INSTALL_FILES)
-
- INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${INT_BUNDLE_NAME}.zip
DESTINATION share/celix/bundles COMPONENT ${INT_BUNDLE_NAME})
- endif(BUNDLE_INSTALL)
-
- SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES
${CMAKE_CURRENT_BINARY_DIR}/${INT_BUNDLE_NAME}.zip)
-ENDMACRO(bundle)
-
-MACRO(install_bundle)
- PARSE_ARGUMENTS(BUNDLE "HEADERS;RESOURCES" "" ${ARGN})
- LIST(GET BUNDLE_DEFAULT_ARGS 0 INT_BUNDLE_NAME)
-
- CELIX_ADD_COMPONENT(${INT_BUNDLE_NAME}
- DISPLAY_NAME ${INT_BUNDLE_NAME}
- DESCRIPTION ${INT_BUNDLE_NAME}
- GROUP bundles
- )
- add_dependencies( install-${INT_BUNDLE_NAME} ${INT_BUNDLE_NAME} )
-
- if (BUNDLE_HEADERS)
- install (FILES ${BUNDLE_HEADERS} DESTINATION
include/celix/${INT_BUNDLE_NAME} COMPONENT ${INT_BUNDLE_NAME})
- endif(BUNDLE_HEADERS)
- if (BUNDLE_RESOURCES)
- install (FILES ${BUNDLE_RESOURCES} DESTINATION
share/celix/${INT_BUNDLE_NAME} COMPONENT ${INT_BUNDLE_NAME})
- endif(BUNDLE_RESOURCES)
-
- INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${INT_BUNDLE_NAME}.zip
DESTINATION share/celix/bundles COMPONENT ${INT_BUNDLE_NAME})
-ENDMACRO(install_bundle)
-
-MACRO(package)
- PARSE_ARGUMENTS(PACKAGE "FILES;DIRECTORIES" "" ${ARGN})
- LIST(GET PACKAGE_DEFAULT_ARGS 0 PACKAGE_NAME)
-
- SET(PACKAGE_COMPONENT package_${PACKAGE_NAME})
-
- get_property(bundle_file TARGET ${INT_BUNDLE_NAME} PROPERTY BUNDLE)
-
- install (FILES ${bundle_file} DESTINATION . COMPONENT
${PACKAGE_COMPONENT})
-
- if (PACKAGE_FILES)
- install (FILES ${PACKAGE_FILES} DESTINATION . COMPONENT
${PACKAGE_COMPONENT})
- endif(PACKAGE_FILES)
- if (PACKAGE_DIRECTORIES)
- install (DIRECTORY ${PACKAGE_DIRECTORIES} DESTINATION . COMPONENT
${PACKAGE_COMPONENT})
- endif(PACKAGE_DIRECTORIES)
-
- SET(__packageConfig
${CMAKE_CURRENT_BINARY_DIR}/CPackConfig-${PACKAGE_NAME}-pkg.cmake)
- CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/cmake/CPackConfigPKG.in
${__packageConfig} @ONLY)
- ADD_CUSTOM_COMMAND(TARGET ${PACKAGE_NAME}
- POST_BUILD
- COMMAND ${CPACK_COMMAND} --config "${__packageConfig}"
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
- )
-
- GET_DIRECTORY_PROPERTY(PROPS ADDITIONAL_MAKE_CLEAN_FILES)
- SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES
"${PROPS};${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}-dev.zip")
-ENDMACRO(package)
-
-
-ADD_CUSTOM_TARGET(deploy)
-MACRO(deploy)
- PARSE_ARGUMENTS(DEPLOY "BUNDLES" "" ${ARGN})
- LIST(GET DEPLOY_DEFAULT_ARGS 0 DEPLOY_NAME)
-
- SET(DEPLOY_COMPONENT deploy_${DEPLOY_NAME})
- SET(__deployTarget deploy_${DEPLOY_NAME})
-
- SET(BUNDLES "")
- SET(DEPS)
- 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)
- ENDFOREACH(BUNDLE)
- IF(NOT(CELIX_FOUND)) #celix project
- set(DEPS ${DEPS};celix)
- ENDIF()
- ADD_CUSTOM_TARGET(${__deployTarget}
- DEPENDS ${DEPS}
- COMMENT "Deploy target ${DEPLOY_NAME}")
- ADD_DEPENDENCIES(deploy ${__deployTarget})
-
- GET_DIRECTORY_PROPERTY(PROPS ADDITIONAL_MAKE_CLEAN_FILES)
- SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES
"${PROPS};${CMAKE_CURRENT_BINARY_DIR}/deploy/${DEPLOY_NAME}/bundles")
-
- CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/cmake/config.properties.in
${CMAKE_CURRENT_BINARY_DIR}/deploy/${DEPLOY_NAME}/config.properties @ONLY)
-
- IF(UNIX)
- 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)
- set(LIBRARY_PATH DYLD_LIBRARY_PATH)
- ELSE(APPLE)
- set(LIBRARY_PATH LD_LIBRARY_PATH)
- ENDIF(APPLE)
- ENDIF(UNIX)
-
- CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/cmake/run.sh.in
${CMAKE_CURRENT_BINARY_DIR}/deploy/${DEPLOY_NAME}/run.sh @ONLY)
-
- # Generate an Eclipse launch file to be able to run the
deployment from Eclipse
- # Linux/unix is assumed since we do only support VS on windows
- string(REPLACE "/" ";" LIST ${PROJECT_BINARY_DIR})
- list(LENGTH LIST len)
- MATH(EXPR test "${len} - 1")
- LIST(GET LIST ${test} last)
-
- SET(CONTAINER_NAME ${DEPLOY_NAME})
- SET(PROGRAM_NAME ${LAUNCHER})
- SET(PROJECT_ATTR ${last})
- SET(WORKING_DIRECTORY
"${CMAKE_CURRENT_BINARY_DIR}/deploy/${DEPLOY_NAME}/")
-
- CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/cmake/RunConfig.in
${CMAKE_CURRENT_BINARY_DIR}/deploy/${DEPLOY_NAME}/${DEPLOY_NAME}.launch @ONLY)
- ENDIF(UNIX)
-
- IF(WIN32)
- GET_FILENAME_COMPONENT(apr_path ${APR_LIBRARY} PATH)
- GET_FILENAME_COMPONENT(aprutil_path ${APRUTIL_LIBRARY} PATH)
- GET_FILENAME_COMPONENT(zlib_path ${ZLIB_LIBRARY} PATH)
- GET_FILENAME_COMPONENT(curl_path ${CURL_LIBRARY} PATH)
-
- 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}")
-
- CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/cmake/vcxproj.user.in
${CMAKE_CURRENT_BINARY_DIR}/deploy_${DEPLOY_NAME}.vcxproj.user @ONLY)
- ENDIF(WIN32)
-ENDMACRO(deploy)
-
-# macro for scanning subdirectories for deploy.cmake files
-# these files contain the deployment of targets
-MACRO(deploy_targets)
- FILE(GLOB_RECURSE new_list deploy.cmake)
- SET(dir_list "")
- FOREACH(file_path ${new_list})
- SET(dir_list ${dir_list} ${file_path})
- ENDFOREACH()
- LIST(REMOVE_DUPLICATES dir_list)
- FOREACH(file_path ${dir_list})
- include(${file_path})
- ENDFOREACH()
-ENDMACRO()
-
-MACRO(PARSE_ARGUMENTS prefix arg_names option_names)
- SET(DEFAULT_ARGS)
- FOREACH(arg_name ${arg_names})
- SET(${prefix}_${arg_name})
- ENDFOREACH(arg_name)
- FOREACH(option ${option_names})
- SET(${prefix}_${option} FALSE)
- ENDFOREACH(option)
-
- SET(current_arg_name DEFAULT_ARGS)
- SET(current_arg_list)
- FOREACH(arg ${ARGN})
- SET(larg_names ${arg_names})
- LIST(FIND larg_names "${arg}" is_arg_name)
- IF (is_arg_name GREATER -1)
- SET(${prefix}_${current_arg_name} ${current_arg_list})
- SET(current_arg_name ${arg})
- SET(current_arg_list)
- ELSE (is_arg_name GREATER -1)
- SET(loption_names ${option_names})
- LIST(FIND loption_names "${arg}" is_option)
- IF (is_option GREATER -1)
- SET(${prefix}_${arg} TRUE)
- ELSE (is_option GREATER -1)
- SET(current_arg_list ${current_arg_list} ${arg})
- ENDIF (is_option GREATER -1)
- ENDIF (is_arg_name GREATER -1)
- ENDFOREACH(arg)
- SET(${prefix}_${current_arg_name} ${current_arg_list})
-ENDMACRO(PARSE_ARGUMENTS)
-
+# 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.
+
+GET_FILENAME_COMPONENT(__cmake_path ${CMAKE_COMMAND} PATH)
+FIND_PROGRAM(CPACK_COMMAND cpack ${__cmake_path})
+MESSAGE(STATUS "Found CPack at: ${CPACK_COMMAND}")
+IF(NOT CPACK_COMMAND)
+ MESSAGE(FATAL_ERROR "Need CPack!")
+ENDIF(NOT CPACK_COMMAND)
+
+include(CPackComponent)
+
+macro( CELIX_ADD_COMPONENT_GROUP _group )
+ set( _readVariable )
+ set( _parentGroup )
+ foreach( _i ${ARGN} )
+ if( _readVariable )
+ set( ${_readVariable} "${_i}" )
+ break()
+ else( _readVariable )
+ if( "${_i}" STREQUAL PARENT_GROUP )
+ set( _readVariable _parentGroup )
+ endif( "${_i}" STREQUAL PARENT_GROUP )
+ endif( _readVariable )
+ endforeach( _i ${ARGN} )
+
+ cpack_add_component_group( ${_group} ${ARGN} )
+ add_custom_target( install-${_group} )
+ if( _parentGroup )
+ add_dependencies( install-${_parentGroup} install-${_group} )
+ endif( _parentGroup )
+endmacro( CELIX_ADD_COMPONENT_GROUP _group )
+
+macro( CELIX_ADD_COMPONENT _component )
+ set( _readVariable )
+ set( _group )
+ foreach( _i ${ARGN} )
+ if( _readVariable )
+ set( ${_readVariable} "${_i}" )
+ break()
+ else( _readVariable )
+ if( "${_i}" STREQUAL GROUP )
+ set( _readVariable _group )
+ endif( "${_i}" STREQUAL GROUP )
+ endif( _readVariable )
+ endforeach( _i ${ARGN} )
+
+ cpack_add_component( ${_component} ${ARGN} )
+ add_custom_target( install-${_component}
+ COMMAND ${CMAKE_COMMAND} -DCOMPONENT=${_component} -P
+"${CMAKE_BINARY_DIR}/cmake_install.cmake" )
+ add_dependencies( install-${_group} install-${_component} )
+endmacro( CELIX_ADD_COMPONENT _component _group )
+
+find_program(JAR_COMMAND jar)
+if(JAR_COMMAND)
+ message(STATUS "Using JAR to repack bundles, bundles can be used by
Apache ACE")
+else(JAR_COMMAND)
+ message("No JAR support, generated bundles are not usable for Apache ACE")
+endif(JAR_COMMAND)
+
+SET(CPACK_GENERATOR "ZIP")
+
+celix_add_component_group(all)
+celix_add_component_group(bundles PARENT_GROUP all)
+
+MACRO(SET_HEADER header content)
+ SET(INT_${header} "${content}")
+ string(STRIP ${INT_${header}} INT_${header})
+ENDMACRO(SET_HEADER)
+
+MACRO(SET_HEADERS content)
+ SET(INT_BUNDLE_EXTRAHEADER "${INT_BUNDLE_EXTRAHEADER}\n${content}")
+ string(STRIP ${INT_BUNDLE_EXTRAHEADER} INT_BUNDLE_EXTRAHEADER)
+ENDMACRO(SET_HEADERS)
+
+MACRO(bundle)
+ PARSE_ARGUMENTS(BUNDLE "SOURCES;FILES;DIRECTORIES;INSTALL_FILES" "INSTALL"
${ARGN})
+ LIST(GET BUNDLE_DEFAULT_ARGS 0 INT_BUNDLE_NAME)
+
+ add_library(${INT_BUNDLE_NAME} SHARED ${BUNDLE_SOURCES})
+ set_property(TARGET ${INT_BUNDLE_NAME} PROPERTY BUNDLE
"${CMAKE_CURRENT_BINARY_DIR}/${INT_BUNDLE_NAME}.zip")
+
+ if (NOT INT_BUNDLE_SYMBOLICNAME)
+ set(INT_BUNDLE_SYMBOLICNAME ${INT_BUNDLE_NAME})
+ endif (NOT INT_BUNDLE_SYMBOLICNAME)
+ if (NOT INT_BUNDLE_VERSION)
+ set(INT_BUNDLE_VERSION ${DEFAULT_VERSION})
+ endif (NOT INT_BUNDLE_VERSION)
+ if (NOT INT_BUNDLE_DESCRIPTION)
+ set(INT_BUNDLE_DESCRIPTION "${INT_BUNDLE_SYMBOLICNAME} bundle")
+ endif (NOT INT_BUNDLE_DESCRIPTION)
+
+ set(INT_BUNDLE_NAME_INSTALL ${INT_BUNDLE_NAME}_install)
+
+ SET(__bundleManifest ${CMAKE_CURRENT_BINARY_DIR}/MANIFEST.MF)
+ CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/cmake/manifest.in ${__bundleManifest}
@ONLY)
+ install (FILES ${__bundleManifest} DESTINATION ./META-INF COMPONENT
${INT_BUNDLE_NAME_INSTALL})
+
+ install (TARGETS ${INT_BUNDLE_NAME} DESTINATION . COMPONENT
${INT_BUNDLE_NAME_INSTALL})
+ if (BUNDLE_FILES)
+ install (FILES ${BUNDLE_FILES} DESTINATION . COMPONENT
${INT_BUNDLE_NAME_INSTALL})
+ endif(BUNDLE_FILES)
+ if (BUNDLE_DIRECTORIES)
+ install (DIRECTORY ${BUNDLE_DIRECTORIES} DESTINATION . COMPONENT
${INT_BUNDLE_NAME_INSTALL})
+ endif(BUNDLE_DIRECTORIES)
+
+ SET(__bundleConfig
${CMAKE_CURRENT_BINARY_DIR}/CPackConfig-${INT_BUNDLE_NAME}-bundle.cmake)
+ SET(BUNDLE_BIN_DIR ${CMAKE_CURRENT_BINARY_DIR})
+ CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/cmake/CPackConfig.in
${__bundleConfig} @ONLY)
+
+ if(JAR_COMMAND)
+ ADD_CUSTOM_COMMAND(TARGET ${INT_BUNDLE_NAME}
+ POST_BUILD
+ COMMAND ${CPACK_COMMAND} ARGS -C Debug --config
${__bundleConfig}
+ COMMAND ${CMAKE_COMMAND} -E make_directory
${CMAKE_CURRENT_BINARY_DIR}/ziptojar
+ COMMAND ${CMAKE_COMMAND} -E chdir
${CMAKE_CURRENT_BINARY_DIR}/ziptojar ${JAR_COMMAND} -xf
${CMAKE_CURRENT_BINARY_DIR}/${INT_BUNDLE_NAME}.zip
+ COMMAND ${CMAKE_COMMAND} -E chdir
${CMAKE_CURRENT_BINARY_DIR}/ziptojar ${JAR_COMMAND} -cfm
${CMAKE_CURRENT_BINARY_DIR}/${INT_BUNDLE_NAME}.zip META-INF/MANIFEST.MF .
+ COMMAND ${CMAKE_COMMAND} -E remove_directory
${CMAKE_CURRENT_BINARY_DIR}/ziptojar
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ )
+ else(JAR_COMMAND)
+ ADD_CUSTOM_COMMAND(TARGET ${INT_BUNDLE_NAME}
+ POST_BUILD
+ COMMAND ${CPACK_COMMAND} ARGS -C Debug --config
${__bundleConfig}
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ )
+ endif(JAR_COMMAND)
+
+ if (BUNDLE_INSTALL)
+ CELIX_ADD_COMPONENT(${INT_BUNDLE_NAME}
+ DISPLAY_NAME ${INT_BUNDLE_SYMBOLICNAME}
+ DESCRIPTION ${INT_BUNDLE_DESCRIPTION}
+ GROUP bundles
+ )
+ add_dependencies( install-${INT_BUNDLE_NAME} ${INT_BUNDLE_NAME} )
+
+ if (BUNDLE_INSTALL_FILES)
+ install (FILES ${BUNDLE_INSTALL_FILES} DESTINATION
include/celix/${INT_BUNDLE_NAME} COMPONENT ${INT_BUNDLE_NAME})
+ endif(BUNDLE_INSTALL_FILES)
+
+ INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${INT_BUNDLE_NAME}.zip
DESTINATION share/celix/bundles COMPONENT ${INT_BUNDLE_NAME})
+ endif(BUNDLE_INSTALL)
+
+ SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES
${CMAKE_CURRENT_BINARY_DIR}/${INT_BUNDLE_NAME}.zip)
+ENDMACRO(bundle)
+
+MACRO(install_bundle)
+ PARSE_ARGUMENTS(BUNDLE "HEADERS;RESOURCES" "" ${ARGN})
+ LIST(GET BUNDLE_DEFAULT_ARGS 0 INT_BUNDLE_NAME)
+
+ CELIX_ADD_COMPONENT(${INT_BUNDLE_NAME}
+ DISPLAY_NAME ${INT_BUNDLE_NAME}
+ DESCRIPTION ${INT_BUNDLE_NAME}
+ GROUP bundles
+ )
+ add_dependencies( install-${INT_BUNDLE_NAME} ${INT_BUNDLE_NAME} )
+
+ if (BUNDLE_HEADERS)
+ install (FILES ${BUNDLE_HEADERS} DESTINATION
include/celix/${INT_BUNDLE_NAME} COMPONENT ${INT_BUNDLE_NAME})
+ endif(BUNDLE_HEADERS)
+ if (BUNDLE_RESOURCES)
+ install (FILES ${BUNDLE_RESOURCES} DESTINATION
share/celix/${INT_BUNDLE_NAME} COMPONENT ${INT_BUNDLE_NAME})
+ endif(BUNDLE_RESOURCES)
+
+ INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${INT_BUNDLE_NAME}.zip
DESTINATION share/celix/bundles COMPONENT ${INT_BUNDLE_NAME})
+ENDMACRO(install_bundle)
+
+MACRO(package)
+ PARSE_ARGUMENTS(PACKAGE "FILES;DIRECTORIES" "" ${ARGN})
+ LIST(GET PACKAGE_DEFAULT_ARGS 0 PACKAGE_NAME)
+
+ SET(PACKAGE_COMPONENT package_${PACKAGE_NAME})
+
+ get_property(bundle_file TARGET ${INT_BUNDLE_NAME} PROPERTY BUNDLE)
+
+ install (FILES ${bundle_file} DESTINATION . COMPONENT
${PACKAGE_COMPONENT})
+
+ if (PACKAGE_FILES)
+ install (FILES ${PACKAGE_FILES} DESTINATION . COMPONENT
${PACKAGE_COMPONENT})
+ endif(PACKAGE_FILES)
+ if (PACKAGE_DIRECTORIES)
+ install (DIRECTORY ${PACKAGE_DIRECTORIES} DESTINATION . COMPONENT
${PACKAGE_COMPONENT})
+ endif(PACKAGE_DIRECTORIES)
+
+ SET(__packageConfig
${CMAKE_CURRENT_BINARY_DIR}/CPackConfig-${PACKAGE_NAME}-pkg.cmake)
+ CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/cmake/CPackConfigPKG.in
${__packageConfig} @ONLY)
+ ADD_CUSTOM_COMMAND(TARGET ${PACKAGE_NAME}
+ POST_BUILD
+ COMMAND ${CPACK_COMMAND} --config "${__packageConfig}"
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ )
+
+ GET_DIRECTORY_PROPERTY(PROPS ADDITIONAL_MAKE_CLEAN_FILES)
+ SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES
"${PROPS};${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}-dev.zip")
+ENDMACRO(package)
+
+
+ADD_CUSTOM_TARGET(deploy)
+MACRO(deploy)
+ PARSE_ARGUMENTS(DEPLOY "BUNDLES" "" ${ARGN})
+ LIST(GET DEPLOY_DEFAULT_ARGS 0 DEPLOY_NAME)
+
+ SET(DEPLOY_COMPONENT deploy_${DEPLOY_NAME})
+ SET(__deployTarget deploy_${DEPLOY_NAME})
+
+ SET(BUNDLES "")
+ SET(DEPS)
+ 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)
+ ENDFOREACH(BUNDLE)
+ IF(NOT(CELIX_FOUND)) #celix project
+ set(DEPS ${DEPS};celix)
+ ENDIF()
+ ADD_CUSTOM_TARGET(${__deployTarget}
+ DEPENDS ${DEPS}
+ COMMENT "Deploy target ${DEPLOY_NAME}")
+ ADD_DEPENDENCIES(deploy ${__deployTarget})
+
+ GET_DIRECTORY_PROPERTY(PROPS ADDITIONAL_MAKE_CLEAN_FILES)
+ SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES
"${PROPS};${CMAKE_CURRENT_BINARY_DIR}/deploy/${DEPLOY_NAME}/bundles")
+
+ CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/cmake/config.properties.in
${CMAKE_CURRENT_BINARY_DIR}/deploy/${DEPLOY_NAME}/config.properties @ONLY)
+
+ IF(UNIX)
+ 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)
+ set(LIBRARY_PATH DYLD_LIBRARY_PATH)
+ ELSE(APPLE)
+ set(LIBRARY_PATH LD_LIBRARY_PATH)
+ ENDIF(APPLE)
+ ENDIF(UNIX)
+
+ CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/cmake/run.sh.in
${CMAKE_CURRENT_BINARY_DIR}/deploy/${DEPLOY_NAME}/run.sh @ONLY)
+
+ # Generate an Eclipse launch file to be able to run the
deployment from Eclipse
+ # Linux/unix is assumed since we do only support VS on windows
+ string(REPLACE "/" ";" LIST ${PROJECT_BINARY_DIR})
+ list(LENGTH LIST len)
+ MATH(EXPR test "${len} - 1")
+ LIST(GET LIST ${test} last)
+
+ SET(CONTAINER_NAME ${DEPLOY_NAME})
+ SET(PROGRAM_NAME ${LAUNCHER})
+ SET(PROJECT_ATTR ${last})
+ SET(WORKING_DIRECTORY
"${CMAKE_CURRENT_BINARY_DIR}/deploy/${DEPLOY_NAME}/")
+
+ CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/cmake/RunConfig.in
${CMAKE_CURRENT_BINARY_DIR}/deploy/${DEPLOY_NAME}/${DEPLOY_NAME}.launch @ONLY)
+ ENDIF(UNIX)
+
+ IF(WIN32)
+ GET_FILENAME_COMPONENT(apr_path ${APR_LIBRARY} PATH)
+ GET_FILENAME_COMPONENT(aprutil_path ${APRUTIL_LIBRARY} PATH)
+ GET_FILENAME_COMPONENT(zlib_path ${ZLIB_LIBRARY} PATH)
+ GET_FILENAME_COMPONENT(curl_path ${CURL_LIBRARY} PATH)
+
+ 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}")
+
+ CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/cmake/vcxproj.user.in
${CMAKE_CURRENT_BINARY_DIR}/deploy_${DEPLOY_NAME}.vcxproj.user @ONLY)
+ ENDIF(WIN32)
+ENDMACRO(deploy)
+
+# macro for scanning subdirectories for deploy.cmake files
+# these files contain the deployment of targets
+MACRO(deploy_targets)
+ FILE(GLOB_RECURSE new_list deploy.cmake)
+ SET(dir_list "")
+ FOREACH(file_path ${new_list})
+ SET(dir_list ${dir_list} ${file_path})
+ ENDFOREACH()
+ LIST(REMOVE_DUPLICATES dir_list)
+ FOREACH(file_path ${dir_list})
+ include(${file_path})
+ ENDFOREACH()
+ENDMACRO()
+
+MACRO(PARSE_ARGUMENTS prefix arg_names option_names)
+ SET(DEFAULT_ARGS)
+ FOREACH(arg_name ${arg_names})
+ SET(${prefix}_${arg_name})
+ ENDFOREACH(arg_name)
+ FOREACH(option ${option_names})
+ SET(${prefix}_${option} FALSE)
+ ENDFOREACH(option)
+
+ SET(current_arg_name DEFAULT_ARGS)
+ SET(current_arg_list)
+ FOREACH(arg ${ARGN})
+ SET(larg_names ${arg_names})
+ LIST(FIND larg_names "${arg}" is_arg_name)
+ IF (is_arg_name GREATER -1)
+ SET(${prefix}_${current_arg_name} ${current_arg_list})
+ SET(current_arg_name ${arg})
+ SET(current_arg_list)
+ ELSE (is_arg_name GREATER -1)
+ SET(loption_names ${option_names})
+ LIST(FIND loption_names "${arg}" is_option)
+ IF (is_option GREATER -1)
+ SET(${prefix}_${arg} TRUE)
+ ELSE (is_option GREATER -1)
+ SET(current_arg_list ${current_arg_list} ${arg})
+ ENDIF (is_option GREATER -1)
+ ENDIF (is_arg_name GREATER -1)
+ ENDFOREACH(arg)
+ SET(${prefix}_${current_arg_name} ${current_arg_list})
+ENDMACRO(PARSE_ARGUMENTS)
+
Modified: incubator/celix/trunk/doap/doap_Celix.rdf
URL:
http://svn.apache.org/viewvc/incubator/celix/trunk/doap/doap_Celix.rdf?rev=1528071&r1=1528070&r2=1528071&view=diff
==============================================================================
--- incubator/celix/trunk/doap/doap_Celix.rdf (original)
+++ incubator/celix/trunk/doap/doap_Celix.rdf Tue Oct 1 12:47:43 2013
@@ -1,58 +1,58 @@
-<?xml version="1.0"?>
-<?xml-stylesheet type="text/xsl"?>
-<!--
-# 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.
- -->
-<rdf:RDF xml:lang="en"
- xmlns="http://usefulinc.com/ns/doap#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:asfext="http://projects.apache.org/ns/asfext#"
- xmlns:foaf="http://xmlns.com/foaf/0.1/">
-<!--
- =======================================================================
-
- Copyright (c) 2012 The Apache Software Foundation.
- All rights reserved.
-
- =======================================================================
--->
- <Project rdf:about="http://incubator.apache.org/celix">
- <created>2010-11-17</created>
- <license rdf:resource="http://usefulinc.com/doap/licenses/asl20"/>
- <name>Apache Celix</name>
- <homepage rdf:resource="http://incubator.apache.org/celix" />
- <asfext:pmc rdf:resource="http://incubator.apache.org" />
- <shortdesc>OSGi framework implementation in C.</shortdesc>
- <description>
- Celix is an implementation of the OSGi specification adapted to C.
- It will follow the API as close as possible, but since the OSGi
specification is written primarily for Java, there will be differences (Java is
OO, C is procedural).
- An important aspect of the implementation is interoperability between
Java and C. This interoperability is achieved by porting and implementing the
Remote Services specification in Celix.
- </description>
- <bug-database rdf:resource="https://issues.apache.org/jira/browse/celix" />
- <download-page
rdf:resource="http://incubator.apache.org/celix/download.html" />
- <mailing-list
rdf:resource="http://incubator.apache.org/celix/support/mailinglist.html" />
- <programming-language>C</programming-language>
- <category
rdf:resource="http://projects.apache.org/category/network-server" />
- <repository>
- <SVNRepository>
- <location
rdf:resource="https://svn.apache.org/repos/asf/incubator/celix"/>
- <browse rdf:resource="http://svn.apache.org/viewvc/incubator/celix/"/>
- </SVNRepository>
- </repository>
- </Project>
-</rdf:RDF>
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl"?>
+<!--
+# 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.
+ -->
+<rdf:RDF xml:lang="en"
+ xmlns="http://usefulinc.com/ns/doap#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:asfext="http://projects.apache.org/ns/asfext#"
+ xmlns:foaf="http://xmlns.com/foaf/0.1/">
+<!--
+ =======================================================================
+
+ Copyright (c) 2012 The Apache Software Foundation.
+ All rights reserved.
+
+ =======================================================================
+-->
+ <Project rdf:about="http://incubator.apache.org/celix">
+ <created>2010-11-17</created>
+ <license rdf:resource="http://usefulinc.com/doap/licenses/asl20"/>
+ <name>Apache Celix</name>
+ <homepage rdf:resource="http://incubator.apache.org/celix" />
+ <asfext:pmc rdf:resource="http://incubator.apache.org" />
+ <shortdesc>OSGi framework implementation in C.</shortdesc>
+ <description>
+ Celix is an implementation of the OSGi specification adapted to C.
+ It will follow the API as close as possible, but since the OSGi
specification is written primarily for Java, there will be differences (Java is
OO, C is procedural).
+ An important aspect of the implementation is interoperability between
Java and C. This interoperability is achieved by porting and implementing the
Remote Services specification in Celix.
+ </description>
+ <bug-database rdf:resource="https://issues.apache.org/jira/browse/celix" />
+ <download-page
rdf:resource="http://incubator.apache.org/celix/download.html" />
+ <mailing-list
rdf:resource="http://incubator.apache.org/celix/support/mailinglist.html" />
+ <programming-language>C</programming-language>
+ <category
rdf:resource="http://projects.apache.org/category/network-server" />
+ <repository>
+ <SVNRepository>
+ <location
rdf:resource="https://svn.apache.org/repos/asf/incubator/celix"/>
+ <browse rdf:resource="http://svn.apache.org/viewvc/incubator/celix/"/>
+ </SVNRepository>
+ </repository>
+ </Project>
+</rdf:RDF>
Modified: incubator/celix/trunk/examples/CMakeLists.txt
URL:
http://svn.apache.org/viewvc/incubator/celix/trunk/examples/CMakeLists.txt?rev=1528071&r1=1528070&r2=1528071&view=diff
==============================================================================
--- incubator/celix/trunk/examples/CMakeLists.txt (original)
+++ incubator/celix/trunk/examples/CMakeLists.txt Tue Oct 1 12:47:43 2013
@@ -1,31 +1,31 @@
-# 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.
-celix_subproject(EXAMPLES "Option to enable building the Examples" "OFF" DEPS
FRAMEWORK LAUNCHER SHELL_TUI LOG_WRITER DEPENDENCY_MANAGER)
-if (EXAMPLES)
- add_subdirectory(hello_world)
- add_subdirectory(mongoose)
-
- add_subdirectory(whiteboard)
- add_subdirectory(echo_service)
-
- add_subdirectory(osgi-in-action/chapter04-correct-lookup)
- add_subdirectory(osgi-in-action/chapter04-correct-listener)
- add_subdirectory(osgi-in-action/chapter01-greeting-example)
- add_subdirectory(osgi-in-action/chapter04-paint-example)
-
- add_subdirectory(embedding)
-endif(EXAMPLES)
+# 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.
+celix_subproject(EXAMPLES "Option to enable building the Examples" "OFF" DEPS
FRAMEWORK LAUNCHER SHELL_TUI LOG_WRITER DEPENDENCY_MANAGER)
+if (EXAMPLES)
+ add_subdirectory(hello_world)
+ add_subdirectory(mongoose)
+
+ add_subdirectory(whiteboard)
+ add_subdirectory(echo_service)
+
+ add_subdirectory(osgi-in-action/chapter04-correct-lookup)
+ add_subdirectory(osgi-in-action/chapter04-correct-listener)
+ add_subdirectory(osgi-in-action/chapter01-greeting-example)
+ add_subdirectory(osgi-in-action/chapter04-paint-example)
+
+ add_subdirectory(embedding)
+endif(EXAMPLES)
Modified: incubator/celix/trunk/examples/mongoose/private/include/mongoose.h
URL:
http://svn.apache.org/viewvc/incubator/celix/trunk/examples/mongoose/private/include/mongoose.h?rev=1528071&r1=1528070&r2=1528071&view=diff
==============================================================================
--- incubator/celix/trunk/examples/mongoose/private/include/mongoose.h
(original)
+++ incubator/celix/trunk/examples/mongoose/private/include/mongoose.h Tue Oct
1 12:47:43 2013
@@ -1,218 +1,218 @@
-// Copyright (c) 2004-2010 Sergey Lyubka
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to
deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-#ifndef MONGOOSE_HEADER_INCLUDED
-#define MONGOOSE_HEADER_INCLUDED
-
-#ifdef __cplusplus
-extern "C" {
-#endif // __cplusplus
-
-struct mg_context; // Handle for the HTTP service itself
-struct mg_connection; // Handle for the individual connection
-
-
-// This structure contains information about the HTTP request.
-struct mg_request_info {
- char *request_method; // "GET", "POST", etc
- char *uri; // URL-decoded URI
- char *http_version; // E.g. "1.0", "1.1"
- char *query_string; // \0 - terminated
- char *remote_user; // Authenticated user
- char *log_message; // Mongoose error log message
- long remote_ip; // Client's IP address
- int remote_port; // Client's port
- int status_code; // HTTP reply status code
- int is_ssl; // 1 if SSL-ed, 0 if not
- int num_headers; // Number of headers
- struct mg_header {
- char *name; // HTTP header name
- char *value; // HTTP header value
- } http_headers[64]; // Maximum 64 headers
-};
-
-// Various events on which user-defined function is called by Mongoose.
-enum mg_event {
- MG_NEW_REQUEST, // New HTTP request has arrived from the client
- MG_HTTP_ERROR, // HTTP error must be returned to the client
- MG_EVENT_LOG, // Mongoose logs an event, request_info.log_message
- MG_INIT_SSL, // Mongoose initializes SSL. Instead of mg_connection *,
- // SSL context is passed to the callback function.
-};
-
-// Prototype for the user-defined function. Mongoose calls this function
-// on every event mentioned above.
-//
-// Parameters:
-// event: which event has been triggered.
-// conn: opaque connection handler. Could be used to read, write data to the
-// client, etc. See functions below that accept "mg_connection *".
-// request_info: Information about HTTP request.
-//
-// Return:
-// If handler returns non-NULL, that means that handler has processed the
-// request by sending appropriate HTTP reply to the client. Mongoose treats
-// the request as served.
-// If callback returns NULL, that means that callback has not processed
-// the request. Handler must not send any data to the client in this case.
-// Mongoose proceeds with request handling as if nothing happened.
-typedef void * (*mg_callback_pt)(enum mg_event event,
- struct mg_connection *conn,
- const struct mg_request_info *request_info);
-
-
-// Start web server.
-//
-// Parameters:
-// callback: user defined event handling function or NULL.
-// options: NULL terminated list of option_name, option_value pairs that
-// specify Mongoose configuration parameters.
-//
-// Example:
-// const char *options[] = {
-// "document_root", "/var/www",
-// "listening_ports", "80,443s",
-// NULL
-// };
-// struct mg_context *ctx = mg_start(&my_func, options);
-//
-// Please refer to http://code.google.com/p/mongoose/wiki/MongooseManual
-// for the list of valid option and their possible values.
-//
-// Return:
-// web server context, or NULL on error.
-struct mg_context *mg_start(mg_callback_pt callback, const char **options);
-
-
-// Stop the web server.
-//
-// Must be called last, when an application wants to stop the web server and
-// release all associated resources. This function blocks until all Mongoose
-// threads are stopped. Context pointer becomes invalid.
-void mg_stop(struct mg_context *);
-
-
-// Get the value of particular configuration parameter.
-// The value returned is read-only. Mongoose does not allow changing
-// configuration at run time.
-// If given parameter name is not valid, NULL is returned. For valid
-// names, return value is guaranteed to be non-NULL. If parameter is not
-// set, zero-length string is returned.
-const char *mg_get_option(const struct mg_context *ctx, const char *name);
-
-
-// Return array of strings that represent valid configuration options.
-// For each option, a short name, long name, and default value is returned.
-// Array is NULL terminated.
-const char **mg_get_valid_option_names(void);
-
-
-// Add, edit or delete the entry in the passwords file.
-//
-// This function allows an application to manipulate .htpasswd files on the
-// fly by adding, deleting and changing user records. This is one of the
-// several ways of implementing authentication on the server side. For another,
-// cookie-based way please refer to the examples/chat.c in the source tree.
-//
-// If password is not NULL, entry is added (or modified if already exists).
-// If password is NULL, entry is deleted.
-//
-// Return:
-// 1 on success, 0 on error.
-int mg_modify_passwords_file(struct mg_context *ctx,
- const char *passwords_file_name, const char *user, const char *password);
-
-// Send data to the client.
-int mg_write(struct mg_connection *, const void *buf, size_t len);
-
-
-// Send data to the browser using printf() semantics.
-//
-// Works exactly like mg_write(), but allows to do message formatting.
-// Note that mg_printf() uses internal buffer of size IO_BUF_SIZE
-// (8 Kb by default) as temporary message storage for formatting. Do not
-// print data that is bigger than that, otherwise it will be truncated.
-int mg_printf(struct mg_connection *, const char *fmt, ...);
-
-
-// Read data from the remote end, return number of bytes read.
-int mg_read(struct mg_connection *, void *buf, size_t len);
-
-
-// Get the value of particular HTTP header.
-//
-// This is a helper function. It traverses request_info->http_headers array,
-// and if the header is present in the array, returns its value. If it is
-// not present, NULL is returned.
-const char *mg_get_header(const struct mg_connection *, const char *name);
-
-
-// Get a value of particular form variable.
-//
-// Parameters:
-// data: pointer to form-uri-encoded buffer. This could be either POST data,
-// or request_info.query_string.
-// data_len: length of the encoded data.
-// var_name: variable name to decode from the buffer
-// buf: destination buffer for the decoded variable
-// buf_len: length of the destination buffer
-//
-// Return:
-// On success, length of the decoded variable.
-// On error, -1 (variable not found, or destination buffer is too small).
-//
-// Destination buffer is guaranteed to be '\0' - terminated. In case of
-// failure, dst[0] == '\0'.
-int mg_get_var(const char *data, size_t data_len,
- const char *var_name, char *buf, size_t buf_len);
-
-// Fetch value of certain cookie variable into the destination buffer.
-//
-// Destination buffer is guaranteed to be '\0' - terminated. In case of
-// failure, dst[0] == '\0'. Note that RFC allows many occurrences of the same
-// parameter. This function returns only first occurrence.
-//
-// Return:
-// On success, value length.
-// On error, -1 (either "Cookie:" header is not present at all, or the
-// requested parameter is not found, or destination buffer is too small
-// to hold the value).
-int mg_get_cookie(const struct mg_connection *,
- const char *cookie_name, char *buf, size_t buf_len);
-
-
-// Return Mongoose version.
-const char *mg_version(void);
-
-
-// MD5 hash given strings.
-// Buffer 'buf' must be 33 bytes long. Varargs is a NULL terminated list of
-// asciiz strings. When function returns, buf will contain human-readable
-// MD5 hash. Example:
-// char buf[33];
-// mg_md5(buf, "aa", "bb", NULL);
-void mg_md5(char *buf, ...);
-
-
-#ifdef __cplusplus
-}
-#endif // __cplusplus
-
-#endif // MONGOOSE_HEADER_INCLUDED
+// Copyright (c) 2004-2010 Sergey Lyubka
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#ifndef MONGOOSE_HEADER_INCLUDED
+#define MONGOOSE_HEADER_INCLUDED
+
+#ifdef __cplusplus
+extern "C" {
+#endif // __cplusplus
+
+struct mg_context; // Handle for the HTTP service itself
+struct mg_connection; // Handle for the individual connection
+
+
+// This structure contains information about the HTTP request.
+struct mg_request_info {
+ char *request_method; // "GET", "POST", etc
+ char *uri; // URL-decoded URI
+ char *http_version; // E.g. "1.0", "1.1"
+ char *query_string; // \0 - terminated
+ char *remote_user; // Authenticated user
+ char *log_message; // Mongoose error log message
+ long remote_ip; // Client's IP address
+ int remote_port; // Client's port
+ int status_code; // HTTP reply status code
+ int is_ssl; // 1 if SSL-ed, 0 if not
+ int num_headers; // Number of headers
+ struct mg_header {
+ char *name; // HTTP header name
+ char *value; // HTTP header value
+ } http_headers[64]; // Maximum 64 headers
+};
+
+// Various events on which user-defined function is called by Mongoose.
+enum mg_event {
+ MG_NEW_REQUEST, // New HTTP request has arrived from the client
+ MG_HTTP_ERROR, // HTTP error must be returned to the client
+ MG_EVENT_LOG, // Mongoose logs an event, request_info.log_message
+ MG_INIT_SSL, // Mongoose initializes SSL. Instead of mg_connection *,
+ // SSL context is passed to the callback function.
+};
+
+// Prototype for the user-defined function. Mongoose calls this function
+// on every event mentioned above.
+//
+// Parameters:
+// event: which event has been triggered.
+// conn: opaque connection handler. Could be used to read, write data to the
+// client, etc. See functions below that accept "mg_connection *".
+// request_info: Information about HTTP request.
+//
+// Return:
+// If handler returns non-NULL, that means that handler has processed the
+// request by sending appropriate HTTP reply to the client. Mongoose treats
+// the request as served.
+// If callback returns NULL, that means that callback has not processed
+// the request. Handler must not send any data to the client in this case.
+// Mongoose proceeds with request handling as if nothing happened.
+typedef void * (*mg_callback_pt)(enum mg_event event,
+ struct mg_connection *conn,
+ const struct mg_request_info *request_info);
+
+
+// Start web server.
+//
+// Parameters:
+// callback: user defined event handling function or NULL.
+// options: NULL terminated list of option_name, option_value pairs that
+// specify Mongoose configuration parameters.
+//
+// Example:
+// const char *options[] = {
+// "document_root", "/var/www",
+// "listening_ports", "80,443s",
+// NULL
+// };
+// struct mg_context *ctx = mg_start(&my_func, options);
+//
+// Please refer to http://code.google.com/p/mongoose/wiki/MongooseManual
+// for the list of valid option and their possible values.
+//
+// Return:
+// web server context, or NULL on error.
+struct mg_context *mg_start(mg_callback_pt callback, const char **options);
+
+
+// Stop the web server.
+//
+// Must be called last, when an application wants to stop the web server and
+// release all associated resources. This function blocks until all Mongoose
+// threads are stopped. Context pointer becomes invalid.
+void mg_stop(struct mg_context *);
+
+
+// Get the value of particular configuration parameter.
+// The value returned is read-only. Mongoose does not allow changing
+// configuration at run time.
+// If given parameter name is not valid, NULL is returned. For valid
+// names, return value is guaranteed to be non-NULL. If parameter is not
+// set, zero-length string is returned.
+const char *mg_get_option(const struct mg_context *ctx, const char *name);
+
+
+// Return array of strings that represent valid configuration options.
+// For each option, a short name, long name, and default value is returned.
+// Array is NULL terminated.
+const char **mg_get_valid_option_names(void);
+
+
+// Add, edit or delete the entry in the passwords file.
+//
+// This function allows an application to manipulate .htpasswd files on the
+// fly by adding, deleting and changing user records. This is one of the
+// several ways of implementing authentication on the server side. For another,
+// cookie-based way please refer to the examples/chat.c in the source tree.
+//
+// If password is not NULL, entry is added (or modified if already exists).
+// If password is NULL, entry is deleted.
+//
+// Return:
+// 1 on success, 0 on error.
+int mg_modify_passwords_file(struct mg_context *ctx,
+ const char *passwords_file_name, const char *user, const char *password);
+
+// Send data to the client.
+int mg_write(struct mg_connection *, const void *buf, size_t len);
+
+
+// Send data to the browser using printf() semantics.
+//
+// Works exactly like mg_write(), but allows to do message formatting.
+// Note that mg_printf() uses internal buffer of size IO_BUF_SIZE
+// (8 Kb by default) as temporary message storage for formatting. Do not
+// print data that is bigger than that, otherwise it will be truncated.
+int mg_printf(struct mg_connection *, const char *fmt, ...);
+
+
+// Read data from the remote end, return number of bytes read.
+int mg_read(struct mg_connection *, void *buf, size_t len);
+
+
+// Get the value of particular HTTP header.
+//
+// This is a helper function. It traverses request_info->http_headers array,
+// and if the header is present in the array, returns its value. If it is
+// not present, NULL is returned.
+const char *mg_get_header(const struct mg_connection *, const char *name);
+
+
+// Get a value of particular form variable.
+//
+// Parameters:
+// data: pointer to form-uri-encoded buffer. This could be either POST data,
+// or request_info.query_string.
+// data_len: length of the encoded data.
+// var_name: variable name to decode from the buffer
+// buf: destination buffer for the decoded variable
+// buf_len: length of the destination buffer
+//
+// Return:
+// On success, length of the decoded variable.
+// On error, -1 (variable not found, or destination buffer is too small).
+//
+// Destination buffer is guaranteed to be '\0' - terminated. In case of
+// failure, dst[0] == '\0'.
+int mg_get_var(const char *data, size_t data_len,
+ const char *var_name, char *buf, size_t buf_len);
+
+// Fetch value of certain cookie variable into the destination buffer.
+//
+// Destination buffer is guaranteed to be '\0' - terminated. In case of
+// failure, dst[0] == '\0'. Note that RFC allows many occurrences of the same
+// parameter. This function returns only first occurrence.
+//
+// Return:
+// On success, value length.
+// On error, -1 (either "Cookie:" header is not present at all, or the
+// requested parameter is not found, or destination buffer is too small
+// to hold the value).
+int mg_get_cookie(const struct mg_connection *,
+ const char *cookie_name, char *buf, size_t buf_len);
+
+
+// Return Mongoose version.
+const char *mg_version(void);
+
+
+// MD5 hash given strings.
+// Buffer 'buf' must be 33 bytes long. Varargs is a NULL terminated list of
+// asciiz strings. When function returns, buf will contain human-readable
+// MD5 hash. Example:
+// char buf[33];
+// mg_md5(buf, "aa", "bb", NULL);
+void mg_md5(char *buf, ...);
+
+
+#ifdef __cplusplus
+}
+#endif // __cplusplus
+
+#endif // MONGOOSE_HEADER_INCLUDED