CMake API¶
cmake/boost_python.cmake¶
- SEARCH_FOR_BOOST_COMPONENT¶
- Param boost_python_name
- Param found
This function returns found to TRUE if the boost_python_name has been found, FALSE otherwise. This function is for internal use only.
- EXPORT_BOOST_DEFAULT_OPTIONS¶
This function allows to export the default options for detecting Boost components.
- SEARCH_FOR_BOOST_PYTHON([REQUIRED])¶
Find boost-python component. For boost >= 1.67.0, FindPython macro should be called first in order to automatically detect the right boost-python component version according to the Python version (2.7 or 3.x).
- TARGET_LINK_BOOST_PYTHON (TARGET <PRIVATE|PUBLIC|INTERFACE>)¶
Link target againt boost_python library.
- Target
is either a library or an executable :private,public,interface: The
PUBLIC, PRIVATE and INTERFACE keywords can be used to specify both the link dependencies and the link interface.
On darwin systems, boost_python is not linked against any python library. This linkage is resolved at execution time via the python interpreter. We then need to stipulate that boost_python has unresolved symbols at compile time for a library target. Otherwise, for executables we need to link to a specific version of python.
cmake/documentation.cmake¶
- CREATE_DOC_TARGET¶
Create a target called doc. This target allows you do perform:
make docThis target is created by default in the cmake/global_calls.cmake. It can be built by default if one set the CMake variable
GENERATE_DOCUMENTATION
to on:cmake .. -DGENERATE_DOCUMENTATION=ON
- ADD_DOCUMENTATION¶
Alias of
add_sphinx_documentation()
.Warning
The following is deprecated. It is used for backward support.
- BUILD_DOCUMENTATION¶
- BUILD_DOXYGEN_DOCUMENTATION¶
- BUILD_SPHINX_DOCUMENTATION¶
cmake/doxygen.cmake¶
- ADD_DOXYGEN_DOCUMENTATION¶
Builds the doxygen html documentation of a package. The Doxyfile is set to parse the Markdown files in the doc/ folder, the Python file in the python/ folder and the C/C++ files. The output is gnerated in install/${PROJECT_NAME}/share/docs/doxygen/html/.
cmake/dynamic_graph.cmake¶
- GET_DYNAMIC_GRAPH_PLUGIN_INSTALL_PATH(INSTALL_DYNAMIC_GRAPH_PLUGIN_PATH)¶
Get the install dir for the plugin to install them in the correct place.
- Param INSTALL_DYNAMIC_GRAPH_PLUGIN_PATH
path to the dynamic graph plugin
cmake-format: on
- INSTALL_DYNAMIC_GRAPH_PLUGIN_PYTHON_BINDINGS(PLUGIN_TARGET)¶
This file allows us to install the Python bindings of the dynamic graph at the correct place.
Add a python submodule to dynamic_graph
- Param plugin_target
target (library) name of the dynamic graph plugin,
cmake-format: on
cmake/find_modules.cmake¶
Simply add the find_modules/* to the CMAKE_MODULE_PATH.
cmake/find_modules/FindPythonModules.cmake¶
cmake/find_modules/FindZeroMQ.cmake¶
cmake/find_modules/FindZeroMQPP.cmake¶
Finds the libzmqpp library.
This module provides the following imported targets, if found:
ZeroMQPP::ZeroMQPP
The ZeroMQPP interface library.
This will define the following variables:
ZeroMQPP_FOUND
True if the system has the ZeroMQPP library.
ZeroMQPP_VERSION
The version of the ZeroMQPP library which was found.
ZeroMQPP_INCLUDE_DIR
Include directory needed to use ZeroMQPP.
ZeroMQPP_LIBRARY
ZeroMPQQ library only library.
cmake/find_modules/Findcereal.cmake¶
Finds the cereal library.
This module provides the following imported targets, if found:
cereal::cereal
The cereal interface library.
This will define the following variables:
cereal_FOUND
True if the system has the cereal library.
cereal_VERSION
The version of the cereal library which was found.
cereal_INCLUDE_DIRS
Include directories needed to use cereal.
cereal_LIBRARIES
Libraries needed to link to cereal. This will be empty as this is a header only library.
The following cache variables may also be set:
cereal_INCLUDE_DIR
The directory containing
cereal.h
.cereal_LIBRARY
The path to the cereal library.
cmake/find_modules/Findrt.cmake¶
Finds the rt library.
This module provides the following imported targets, if found:
rt::rt
The rt interface library.
This will define the following variables:
rt_FOUND
True if the system has the rt library.
rt_VERSION
The version of the rt library which was found.
rt_INCLUDE_DIRS
Include directories needed to use rt.
rt_LIBRARIES
Libraries needed to link to rt. This will be empty as this is a header only library.
The following cache variables may also be set:
rt_INCLUDE_DIR
The directory containing
rt.h
.rt_LIBRARY
The path to the rt library.
cmake/find_modules/XenomaiConfig.cmake¶
Find the Xenamai library. Usage:
find_package(Xenomai REQUIRED)
cmake/find_modules/python/FindPython.cmake¶
cmake/generate_cmake_package.cmake¶
cmake/get_python_install_dir.cmake¶
cmake/get_python_interpreter.cmake¶
cmake/global_calls.cmake¶
cmake/install_scripts.cmake¶
Install scripts without their file extension.
- INSTALL_SCRIPTS¶
Expects as argument a list of files and a
DESTINATION
parameter with an installation destination.The files are installed as programs (i.e. as executables) with the file extension (e.g. “.py”) striped from their names.
cmake/os_detection.cmake¶
This file allows us to detect which linux os we are using to compile the code.
- DEFINE_OS¶
Executes
uname -a
to detect the OS and sets some flags accordingly. Alternatively, the target OS can explicitly be specified by setting the variableOS_VERSION
before calling this macro (useful for cross compiling).Supported OS_VERSIONs are:
* "xenomai" * "preempt-rt" / "lowlatency" * "non-real-time"/"ubuntu" * "darwin" (Mac-OS)It also discriminate between real-time and non-real-time (or low latency) OS (kernel).
cmake/print_target_properties.cmake¶
cmake/pybind11.cmake¶
Add a Python module using pybind11
- ADD_PYBIND11_MODULE¶
Create a pybind11 module. First argument is the target name (needs to match the name of the Python module!) followed by a list of source files.
- Optional arguments:
LINK_LIBRARIES: List of libraries that are linked to the target.
INLUCDE_DIRS: List of include directories. “include” is added by default.
cmake/sphinx.cmake¶
- _BUILD_DOXYGEN¶
Use doxygen to parse the C++ source files and generate a corresponding xml entry.
- _BUILD_BREATHE_APIDOC¶
Use breathe_apidoc to parse the xml output from Doxygen and generate .rst files.
- _BUILD_SPHINX_API_DOC¶
Use sphinx_apidoc to parse the python files output from Doxygen and generate .rst files.
- _BUILD_SPHINX_BUILD¶
Use sphinx_build to parse the cmake and rst files previously generated and generate the final html layout.
- _FIND_README¶
Search for a README with the given file extension and, if found, return its name using
OUTPUT_VAR
. Example to search for ‘readme.md’:_FIND_README(readme_file "md")
- ADD_SPHINX_DOCUMENTATION¶
Process the current project in order to generate a specific documentation content. This macro generates the appropriate documentation if is detects the corresponding files:
* *files* with the extensions {.h, .cpp, ...} generates the *C++ API* section. * the *python* folder will generate the *Python API* section. * the *cmake* folder will generate the *CMake API* section. * the *doc* folder containing markdown files (*.md*) will generate the *Additionnal Documentation* section.The following macros are called in order and if needed:: * :command: _BUILD_DOXYGEN * :command: _BUILD_BREATHE_APIDOC * :command: _BUILD_SPHINX_API_DOC * :command: _BUILD_SPHINX_BUILD
Please refer to the Sphinx paragraph in the General Documentation in this package for more explanation about the parametrization of the tools.
Optional Arguments:
- DOXYGEN_EXCLUDE_PATTERNS: List of strings that are added to
EXCLUDE_PATTERNS in the doxygen configuration. They can use wildcards, for example “${PROJECT_SOURCE_DIR}/*/build/*” to exclude any directory called “build” in the package directory. Always put ${PROJECT_SOURCE_DIR} at the beginning of the pattern to avoid unintended matches on higher up parts on the path, which would result in all the files of the package being excluded.
cmake/xacro.cmake¶
Build the documentation based on sphinx and the read_the_doc layout.
- BUILD_XACRO_FILES¶
This looks for any files ending with .urdf.xacro in the [package_root]/xacro folder. Then it calls the xacro command on each and every file found. It then declare a target whith the xacro command.
Note
This all boils down to the following fact, at compile time the [package_root]/urdf/.urdf files are going to be compiled from the [package_root]/xacro/.urdf.xacro files.
cmake/xenomai.cmake¶
- SETUP_XENOMAI¶
calls xeno-config
add suitable libraries to linked directories
add suitable directories to include directories
setup variable
Xenomai_LIBS
.Note
Has been tested only on Xenomai 2.6.