7. CMake options

eProsima Fast DDS provides numerous CMake options for changing the behavior and configuration of Fast DDS. These options allow the user to enable/disable certain Fast DDS settings by defining these options to ON/OFF at the CMake execution. This section is structured as follows: first, the CMake options for the general configuration of Fast DDS are described; then, the options related to the third party libraries are presented; finally, the possible options for the building of Fast DDS tests are defined.

7.1. General options

The Fast DDS CMake options for configuring general settings are shown below, together with their description and dependency on other options.

Option

Description

Possible values

Default

EPROSIMA_INSTALLER

Creates a build for Windows binary installers. Specifically it adds to the list of
components to install (CPACK_COMPONENTS_ALL) the libraries corresponding
to the Microsoft Visual C++ compiler (MSVC). Setting EPROSIMA_INSTALLER
to ON has the following effects on other options:

  • EPROSIMA_BUILD is set to ON.

  • BUILD_DOCUMENTATION is set to ON.

  • INSTALL_EXAMPLES is set to ON.

ON OFF

OFF

EPROSIMA_BUILD

Activates internal Fast DDS builds. It is set to ON if EPROSIMA_INSTALLER is
ON. Setting EPROSIMA_BUILD to ON has the following effects on other
options:

  • INTERNAL_DEBUG is set to ON.

  • COMPILE_EXAMPLES is set to ON if EPROSIMA_INSTALLER is OFF.

  • THIRDPARTY_fastcdr is set to ON if it was not set to FORCE.

  • THIRDPARTY_Asio is set to ON if it was not set to FORCE.

  • THIRDPARTY_TinyXML2 is set to ON if it was not set to FORCE.

  • THIRDPARTY_android-ifaddrs is set to ON if it was not set to FORCE.

  • EPROSIMA_BUILD_TESTS is set to ON if EPROSIMA_INSTALLER is OFF.

ON OFF

OFF

BUILD_SHARED_LIBS

Builds internal libraries as shared libraries, i.e. cause add_library() CMake
function to create shared libraries if on. All libraries are built shared unless the
library was explicitly added as a static library.

ON OFF

ON

SECURITY

Activates the Fast DDS security module. Please refer to Security for more
information on security module.

ON OFF

OFF

NO_TLS

Disables Transport Layer Security (TLS) Support. Please refer to TLS over TCP
for more information on Fast DDS TLS configuration.

ON OFF

OFF

SHM_TRANSPORT_DEFAULT

Adds Shared Memory transport (SHM) to the default transports. Please refer to
SHM section for more information on Fast DDS SHM transport.

ON OFF

ON

FASTDDS_STATISTICS

Enables the Fast DDS Statistics module. Please refer to Statistics Module for
more information on this module.

ON OFF

ON

COMPILE_EXAMPLES

Builds the Fast DDS examples. It is set to ON if EPROSIMA_BUILD is ON and
EPROSIMA_INSTALLER is OFF. These examples can be found in the
eProsima Fast DDS GitHub repository.

ON OFF

OFF

INSTALL_EXAMPLES

Installs the Fast DDS examples, i.e. adds the Fast DDS examples to the list of
components to install (CPACK_COMPONENTS_ALL). It is set to ON if
EPROSIMA_INSTALLER is ON.

ON OFF

OFF

BUILD_DOCUMENTATION

Uses doxygen to create the Fast DDS API reference documentation. It is set to
ON if EPROSIMA_INSTALLER is ON or if CHECK_DOCUMENTATION is ON.

ON OFF

OFF

CHECK_DOCUMENTATION

Downloads Fast DDS documentation from Read the Docs media servers. The
documentation files are extracted in the doc/manual directory, updating
any previous version already downloaded.
If CHECK_DOCUMENTATION is ON, BUILD_DOCUMENTATION is set to ON.

ON OFF

OFF

STRICT_REALTIME

Enables a strict real-time behaviour. Please refer to the Real-Time Use Case for
more information on Fast DDS real-time configuration.

ON OFF

OFF

SQLITE3_SUPPORT

Builds the SQLITE3 Plugin, which enables the TRANSIENT_DURABILITY_QOS
and PERSISTENT_DURABILITY_QOS options for the DurabilityQosPolicyKind
and therefore the Persistence Service.

ON OFF

ON

APPEND_PROJECT_NAME_TO_INCLUDEDIR

When ON headers are installed to a path ending with a folder called fastrtps.
This avoids include directory search order issues when overriding this package
from a merged catkin, ament, or colcon workspace.

ON OFF

OFF

USE_THIRDPARTY_SHARED_MUTEX

When ON a custom implementation of shared_mutex is used instead of the STL one.
The C++ Standard has not yet (C++20) imposed any requirements on shared_mutex
priority policies implementation, as POSIX does, thus each platform made its own choices:

  • Windows & Boost defaults to PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP.

  • Linux & Mac defaults to PTHREAD_RWLOCK_PREFER_READER_NP.

Fast-DDS requires the use of PTHREAD_RWLOCK_PREFER_READER_NP which is the one enforced
in its deadlock prevention logic.

Fast-DDS will test the framework STL implementation (if available) and will only use it if
it enforces PTHREAD_RWLOCK_PREFER_READER_NP. Otherwise it will automatically fallback to
a custom implementation.

This flag will enforce the use of the custom implementation in all cases.

Note that setting the flag OFF will not prevent the use of the custom implementation
in those frameworks that default to PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP.

This flag prevents spurious thread sanitizer reports on GCC/Clang STL implementations.

ON OFF

OFF (Linux & Mac), ON (Windows)

SANITIZER

Adds run-time instrumentation to the code. Supported options are:

  • Thread enables Thread Sanitizer.

  • Address enables Address Sanitizer.

OFF
Address
Thread

OFF

7.2. Log options

Fast DDS uses its own configurable Log module with different verbosity levels. Please, refer to Logging section for more information.

This module can be configured using Fast DDS CMake arguments regarding the following options.

Option

Description

Possible values

Default

LOG_CONSUMER_DEFAULT

Selects the default log consumer for the logging module.
AUTO has the same behavior as STDOUT.
For more information, please refer to Log consumers.

AUTO STDOUT
STDOUTERR

AUTO

LOG_NO_INFO

Deactivates Info Log level.
If Fast DDS is built in debug mode for Single-Config generators,
the default value will be OFF.

ON OFF

ON

FASTDDS_ENFORCE_LOG_INFO

Enables Info Log level even on non Debug configurations.
This option only takes action if LOG_NO_INFO is set to OFF
(see Disable Logging Module).
Mind that this may entail a significant performance hit.

ON OFF

OFF

LOG_NO_WARNING

Deactivates Warning Log level.

ON OFF

OFF

LOG_NO_ERROR

Deactivates Error Log level.

ON OFF

OFF

INTERNAL_DEBUG

Activates compilation of log messages
(See Disable Logging Module).
Moreover, INTERNAL_DEBUG is set to ON if
EPROSIMA_BUILD is ON.

ON OFF

OFF

ENABLE_OLD_LOG_MACROS

Enable old log macros
(See Old Log macros disable).

ON OFF

ON

7.3. Third-party libraries options

Fast DDS relies on the eProsima FastCDR library for serialization mechanisms. Moreover, Fast DDS requires two external dependencies for its proper operation: Asio and TinyXML2. Asio is a cross-platform C++ library for network and low-level I/O programming, while TinyXML2 parses the XML profile files, so Fast DDS can use them (see XML profiles). These three libraries (eProsima FastCDR, Asio and TinyXML2) can be installed by the user, or downloaded on the Fast DDS build. In the latter case, they are referred to as Fast DDS internal third-party libraries. This can be done by setting either THIRDPARTY or EPROSIMA_BUILD to ON.

These libraries can also be configured using Fast DDS CMake options.

Option

Description

Possible values

Default

THIRDPARTY_fastcdr

ON activates the use of the internal Fast CDR third-party library if it is not
found elsewhere in the system.
FORCE activates the use of the internal Fast CDR third-party library
regardless of whether it can be found elsewhere in the system.
OFF deactivates the use of the internal Fast CDR third-party library.
If it is not set to FORCE, it is set to ON if EPROSIMA_BUILD is ON.

ON OFF FORCE

OFF

THIRDPARTY_Asio

ON activates the use of the internal Asio third-party library if it is not
found elsewhere in the system.
FORCE activates the use of the internal Asio third-party library
regardless of whether it can be found elsewhere in the system.
OFF deactivates the use of the internal Asio third-party library.
If it is not set to FORCE, it is set to ON if EPROSIMA_BUILD is ON.

ON OFF FORCE

OFF

THIRDPARTY_TinyXML2

ON activates the use of the internal TinyXML2 third-party library if it is not
found elsewhere in the system.
FORCE activates the use of the internal TinyXML2 third-party library
regardless of whether it can be found elsewhere in the system.
OFF deactivates the use of the internal TinyXML2 third-party library.
If it is not set to FORCE, it is set to ON if EPROSIMA_BUILD is ON.

ON OFF FORCE

OFF

THIRDPARTY_android-ifaddrs

android-ifaddrs is an implementation of getifaddrs() for Android.
Only used if ANDROID is 1.
ON activates the use of the internal android-ifaddrs third-party library if it is not
found elsewhere in the system.
FORCE activates the use of the internal android-ifaddrs third-party library
regardless of whether it can be found elsewhere in the system.
OFF deactivates the use of the internal android-ifaddrs third-party library.
If it is not set to FORCE, it is set to ON if EPROSIMA_BUILD is ON.

ON OFF FORCE

OFF

THIRDPARTY

Unless they are otherwise specified, sets value of all third-party
git submodules THIRDPARTY_fastcdr, THIRDPARTY_Asio,
THIRDPARTY_TinyXML2, and THIRDPARTY_android-ifaddrs.

ON OFF FORCE

OFF

THIRDPARTY_UPDATE

Activates the update of all third-party git submodules.

ON OFF

ON

Note

ANDROID is a CMake environment variable that is set to 1 if the target system (CMAKE_SYSTEM_NAME) is Android.

7.4. Test options

eProsima Fast DDS comes with a full set of tests for continuous integration. The types of tests are: unit tests, black-box tests, performance tests, profiling tests, and XTypes tests. The building and execution of these tests is specified by the Fast DDS CMake options shown in the table below.

Option

Description

Possible values

Default

FASTRTPS_API_TESTS

Enables the building of black-box tests for the verification of RTPS communications
using the Fast DDS RTPS-layer API.

ON OFF

OFF

FASTDDS_PIM_API_TESTS

Enables the building of black-box tests for the verification of DDS communications
using the Fast DDS DDS-layer API.

ON OFF

OFF

FASTDDS_EXAMPLE_TESTS

Enables the building of example tests for the verification of the Fast DDS examples

ON OFF

OFF

PERFORMANCE_TESTS

Activates the building of performance tests, except for the video test, which requires
both PERFORMANCE_TESTS and VIDEO_TESTS to be set to ON.

ON OFF

OFF

PROFILING_TESTS

Activates the building of profiling tests using Valgrind.

ON OFF

OFF

EPROSIMA_BUILD_TESTS

Activates the building of black-box, unit, xtypes, RTPS communication and
DDS communication tests. It is set to ON if EPROSIMA_BUILD is ON and
EPROSIMA_INSTALLER is OFF.

ON OFF

OFF

VIDEO_TESTS

If PERFORMANCE_TESTS is ON, it will activate the building of video performance tests.

ON OFF

OFF

DISABLE_UDPV6_TESTS

Disables UDPv6 tests.

ON OFF

OFF

INSTALL_ANDROID_TESTS

Android cross-compilation only. Marks the tests for installation on the
connected device/emulator.

ON OFF

OFF

ANDROID_TESTING_ROOT

Android cross-compilation only. Path on the Android device/emulator to
use for installing and running the tests.

Valid Unix filesystem path string

""