#Apache Celix - CMake Commands
For Apache Celix several cmake command are added to be able to work with Apache Celix bundles and deployments.
#Bundles
##add_bundle Add a bundle to the project. There are three variants:
add_bundle(<bundle_target_name> SOURCES source1 source2 ... [NAME bundle_name] [SYMBOLIC_NAME bundle_symbolic_name] [DESCRIPTION bundle_description] [VERSION bundle_version] [PRIVATE_LIBRARIES private_lib1 private_lib2 ...] [EXPORT_LIBRARIES export_lib1 export_lib2 ...] [IMPORT_LIBRARIES import_lib1 import_lib2 ...] [HEADERS "header1: header1_value" "header2: header2_value" ...] )
add_bundle(<bundle_target_name> ACTIVATOR <activator_lib> [NAME bundle_name] [SYMBOLIC_NAME bundle_symbolic_name] [DESCRIPTION bundle_description] [VERSION bundle_version] [PRIVATE_LIBRARIES private_lib1 private_lib2 ...] [EXPORT_LIBRARIES export_lib1 export_lib2 ...] [IMPORT_LIBRARIES import_lib1 import_lib2 ...] [HEADERS "header1: header1_value" "header2: header2_value" ...] )
add_bundle(<bundle_target_name> [NAME bundle_name] [SYMBOLIC_NAME bundle_symbolic_name] [DESCRIPTION bundle_description] [VERSION bundle_version] [PRIVATE_LIBRARIES private_lib1 private_lib2 ...] [EXPORT_LIBRARIES export_lib1 export_lib2 ...] [IMPORT_LIBRARIES import_lib1 import_lib2 ...] [HEADERS "header1: header1_value" "header2: header2_value" ...] )
##bundle_private_libs Add libraries to a bundle target. The libraries should be cmake library targets or an absolute path to a existing library.
bundle_private_libs(<bundle_target> lib1 lib2 ... )
##bundle_files Add files to the target bundle. DESTINATION is relative to the bundle archive root. The rest of the command is conform file(COPY ...) cmake command. See cmake file(COPY ...) command for more info.
bundle_files(<bundle_target> files... DESTINATION <dir> [FILE_PERMISSIONS permissions...] [DIRECTORY_PERMISSIONS permissions...] [NO_SOURCE_PERMISSIONS] [USE_SOURCE_PERMISSIONS] [FILES_MATCHING] [[PATTERN <pattern> | REGEX <regex>] [EXCLUDE] [PERMISSIONS permissions...]] [...]) )
##bundle_headers Append the provided headers to the target bundle manifest.
bundle_headers(<bundle_target> "header1: header1_value" "header2: header2_value" ... )
##bundle_symbolic_name Set bundle symbolic name
bundle_symbolic_name(<bundle_target> symbolic_name)
##bundle_name Set bundle name
bundle_name(<bundle_target> name)
##bundle_version Set bundle version
bundle_version(<bundle_target> version)
##bundle_description Set bundle description
bundle_description(<bundle_target> description)
##install_bundle Install bundle when ‘make install’ is executed. Bundles are installed at <install-prefix>/share/<project_name>/bundles
. Headers are installed at <install-prefix>/include/<project_name>/<bundle_name>
Resources are installed at <install-prefix>/shared/<project_name>/<bundle_name>
install_bundle(<bundle_target> [PROJECT_NAME] project_name [BUNDLE_NAME] bundle_name [HEADERS header_file1 header_file2 ...] [RESOURCES resource1 resource2 ...] )
#Deployments
#add_deploy Add a deployment, consisting out of a selection of bundles, for the project. Deployments can be used to run/test a selection of bundles in the celix framework. A deployment can be found in <cmake_build_dir>/deploy[/<group_name>]/<deploy_name>
. Use the run.sh to run the deployments.
add_deploy(<deploy_target_name> [COPY] [GROUP group_name] [NAME deploy_name] [BUNDLES <bundle1> <bundle2> ...] [PROPERTIES "prop1=val1" "prop2=val2" ...] )
The provided bundle targets for a deployment do not have to exists (yet). This removes the need for correctly ordening the add_bundle commands so that all bundle target are present before an add_deploy command. If the bundle target is never added CMake will give an error:
Error evaluating generator expression: $<TARGET_PROPERTY:foo,BUNDLE_FILE>
#deploy_bundles_dir Deploy a selection of bundles to the provided bundle dir. This can be used to create an endpoints / proxies bundles dir for the remote service admin or drivers bundles dir for the device access.
deploy_bundles_dir(<deploy_target_name> DIR_NAME dir_name BUNDLES bundle1 bundle2 ... )
#deploy_bundles Deploy the selected bundles. The bundles are configured for auto starting.
deploy_bundles(<deploy_target_name> bundle1 bundle2 ... )
#deploy_properties
Add the provided properties to the target deploy config.properties. deploy_properties(<deploy_target_name> "prop1=val1" "prop2=val2" ... )