Skip to content

Automatic dependencies fetching

Automatic dependencies fetch is allowed by pull_extra_module:

pull_extra_module("DataStream" "https://gitlab.in2p3.fr/CTA-LAPP/PHOENIX_LIBS2/serialize-io/DataStream.git")
This function behaves as find_package when the dependency is found in the given installation prefix, or CMAKE_MODULE_PATH. And, when dependency is not found, pull_extra_module will get the project at the given url via a git clone.

Extra information such as branch, tag or commit hash can be given to the function:

pull_extra_module("DataStream" "https://gitlab.in2p3.fr/CTA-LAPP/PHOENIX_LIBS2/serialize-io/DataStream.git" master)
Can be useful to pin dependencies version to a given tag.

Library versionning

Versionning libraries in CMake is not hard but tedious. To handle it nicely you can use:

phoenix_add_library(lib_name source.cpp)
It wraps the classic add_library of cmake and uses the project version defined with phoenix_base_project (see in part "SimpleUse").

Libraries type is controlled with the PHOENIX_BUILD_TYPE cmake variable: - Dynamic : build only dynamic libraries (default value) (.so) - DynamicAndStatic : build static and dynamic libraries (.a and .so) - StaticOnly : build only static libraries (.a)

Only dynamic libraries are versionned.