For Apache Celix several cmake command are added to be able to work with Apache Celix bundles and deployments.
Add a Celix bundle to the project. There are three variants:
Also available under the add_bundle CMake function (deprecated).
add_celix_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_celix_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_celix_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" ...]
)
Add libraries to a bundle target. The libraries should be cmake library targets or an absolute path to a existing library.
celix_bundle_private_libs(<bundle_target>
lib1 lib2 ...
)
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.
celix_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...]] [...])
)
Append the provided headers to the target bundle manifest.
celix_bundle_headers(<bundle_target>
"header1: header1_value"
"header2: header2_value"
...
)
Set bundle symbolic name
celix_bundle_symbolic_name(<bundle_target> symbolic_name)
Set bundle name
celix_bundle_name(<bundle_target> name)
Set bundle version
celix_bundle_version(<bundle_target> version)
Set bundle description
celix_bundle_description(<bundle_target> description)
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_celix_bundle(<bundle_target>
[PROJECT_NAME] project_name
[BUNDLE_NAME] bundle_name
[HEADERS header_file1 header_file2 ...]
[RESOURCES resource1 resource2 ...]
)
Add a Celix container, consisting out of a selection of bundles and a simple Celix launcher.
Celix containers can be used to run/test a selection of bundles in the celix framework.
A Celix container can be found in <cmake_build_dir>/deploy[/<group_name>]/<celix_container_name>
.
Use the <celix_container_name>
executable to run the deployments.
Also available under the add_deploy CMake function (deprecated).
add_celix_container(<celix_container_name>
[COPY]
[CXX]
[GROUP group_name]
[NAME celix_container_name]
[LAUNCHER launcher]
[DIR dir]
[BUNDLES <bundle1> <bundle2> ...]
[PROPERTIES "prop1=val1" "prop2=val2" ...]
)
The provided bundle targets for a celix container do not have to exists (yet). This removes the need for correctly ordering the add_celix_bundle commands so that all bundle target are present before an add_celix_container command. If the bundle target is never added CMake will give an error:
Error evaluating generator expression:
$<TARGET_PROPERTY:foo,BUNDLE_FILE>
<cmake_build_dir>/deploy
as deploy dirDeploy 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.
celix_container_bundles_dir(<celix_container_target_name>
DIR_NAME dir_name
BUNDLES
bundle1
bundle2
...
)
Deploy the selected bundles. The bundles are configured for auto starting.
celix_container_bundles(<celix_container_target_name>
bundle1
bundle2
...
)
Add the provided properties to the target Celix container config.properties.
celix_container_properties(<celix_container_target_name>
"prop1=val1"
"prop2=val2"
...
)
Embeds the provided properties to the target Celix launcher as embedded properties. Note that these properties can be overridden by using config.properties.
celix_container_embedded_properties(<celix_container_target_name>
"prop1=val1"
"prop2=val2"
...
)
It is possible the use the add_celix_docker
Apache Celix CMake command to create Apache Celix docker directories,
which in turn can be used to create very small Apache Celix docker images.
Adds a docker target dir, containing a all the required executables, libraries and filesystem needed to run a Apache Celix framework in a docker container. Also includes the selected bundles.
The add_celix_docker target is a executable target and can be used to link libraries which are needed in the docker image.
The docker dir can be found in <cmake_build_dir>/docker[/<group_name>]/<docker_name>
.
The provided bundle targets for a docker dir do not have to exists (yet).
This removes the need for correctly order the add_celix_bundle commands so that all bundle target are present before
an add_celix_docker
command.
If the bundle target is never added CMake will give an error:
Error evaluating generator expression:
$<TARGET_PROPERTY:foo,BUNDLE_FILE>
add_celix_docker(<docker_target_name>
[CXX]
[GROUP group_name]
[NAME deploy_name]
[FROM docker_from_image]
[BUNDLES_DIR bundle_dir_in_docker_image]
[WORKDIR workdir_in_docker_image]
[IMAGE_NAME docker_image_name]
[BUNDLES <bundle1> <bundle2> ...]
[PROPERTIES "prop1=val1" "prop2=val2" ...]
[INSTRUCTIONS "instr1" "instr2" ...]
)
FROM scratch
is used and
a minimal filesystem will be created for the docker image/bundles
will be used/root
will be usedconfig.properties
config.properties
fileDockerfile