svn commit: r1623876 - in /celix/trunk/cmake: FindCELIX.cmake cmake_celix/Packaging.cmake

2014-09-09 Thread pnoltes
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=1623876r1=1623875r2=1623876view=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=1623876r1=1623875r2=1623876view=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 

svn commit: r1623877 - /celix/site/trunk/content/documentation/getting_started.md

2014-09-09 Thread pnoltes
Author: pnoltes
Date: Tue Sep  9 20:04:47 2014
New Revision: 1623877

URL: http://svn.apache.org/r1623877
Log:
CELIX-144: added first draft of getting started documented. not yet complete or 
ready for public view ..

Added:
celix/site/trunk/content/documentation/getting_started.md

Added: celix/site/trunk/content/documentation/getting_started.md
URL: 
http://svn.apache.org/viewvc/celix/site/trunk/content/documentation/getting_started.md?rev=1623877view=auto
==
--- celix/site/trunk/content/documentation/getting_started.md (added)
+++ celix/site/trunk/content/documentation/getting_started.md Tue Sep  9 
20:04:47 2014
@@ -0,0 +1,208 @@
+##Intro
+This page is intended for first time users of Apache Celix. It should guide 
you through building  installing Apache Celix, setting up a new eclipse 
project, creating your first bundle and finally running and debugging your 
bundle directly from eclipse workspace. 
+
+If there are any uncertainties or question, don't hesitate to ask your 
questions in the [Apache Celix 
mailing](https://celix.apache.org/support/mailinglist.html).
+
+##Prerequisite
+Some experience with a command line interface (X terminal) is expected to be 
able to follow this guide. 
+
+The following packages (libraries + headers) should be installed on the system:
+
+*  Development Environment
+   *   build-essentials (duh)
+   *   subversion
+   *   cmake
+*  Apache Celix Dependencies
+   *   apr
+   *   apr-util
+   *   curl
+   *   jansson
+
+For a debian based systems, the following command could help:
+pre
+apt-get install -yq --no-install-recommends \
+   build-essential \
+   curl \
+   libapr1-dev \
+   libaprutil1-dev \
+   subversion \
+   libjansson-dev \
+   libcurl4-openssl-dev \
+   cmake 
+/pre
+
+
+##Building  Installing Apache Celix
+To get started we first have to install Apache Celix, to do this you can 
download a source release from the [download page](/celix/download.cgi) or 
checkout the latest version from svn. For this getting started guide the latest 
trunk version is assumed. Then choose a workspace dir to work in , set the 
location to the environment variable WS and follow the following guide:
+
+   #Create a new workspace to work in
+   
+   #e.g 
+   #mkdir ${HOME}/workspace
+   #export WS=${HOME}/workspace
+   
+   cd ${WS}
+   
+   #checkout Apache Celix
+   svn co https://svn.apache.org/repos/asf/celix/trunk/ celix-src
+   
+   #create a build directory to build Celix in (out of source build)
+   mkdir celix-build
+   
+   #build Apache Celix with the default settings
+   #Note1  if you want to change the install path add 
-DCMAKE_INSTALL_PREFIX=/opt/local
+   #Note2  If you want to be able to edit all the available options, 
+   #   use the ccmake (ncursus) instead of cmake. 
+   #TODO check which bundles or on default. probably not shell  
shell_tui...
+   cd celix-build
+   cmake ../celix-src
+   make all 
+   
+   #install the framework and the bundles
+   make install-all
+   
+##Installing Eclipse CDT
+Download the latest eclipse CDT at [www.eclipse.org](www.eclipse.org) and 
install it on your system. For more information on how the install eclipse on 
your system consult the eclipse documentation. In this getting started guide 
the luna version of eclipse was used 
([linux](http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/luna/R/eclipse-cpp-luna-R-linux-gtk-x86_64.tar.gz)
 
[mac](http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/luna/R/eclipse-cpp-luna-R-macosx-cocoa-x86_64.tar.gz)).
+
+
+   
+##Apache Celix Bundle project
+Create a new project dir to work in:
+   
+   mkdir ${WS}/myproject
+   cd ${WS}/myproject
+   
+For Apache Celix and an Apache Celix Bundle project CMake is used as build 
system. CMake is a cross platform build system which is uses a declarative way 
of describing build. This getting started will only roughly explain how CMake 
works, for a more detail introduction on CMake consult the CMake documentation. 
+
+The Apache Celix installed additional cmake files to extend the default 
functionality of CMake to support the creating and testing of OSGi bundles.
+
+CMake expects a CMakeLists.txt file in the root of a project directory. To get 
started add an initial CMakeLists.txt file to the project root with your 
favourite editor:
+   
+   #${WS}/myproject/CMakeLists.txt
+   
+   #PART1
+   cmake_minimum_required(VERSION 2.8)
+   project(myproject C)
+   cmake_policy(SET CMP0012 NEW)
+   
+   #PART2
+   set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} 
/usr/share/celix/cmake/modules)
+   find_package(CELIX REQUIRED)
+