rapids_cpm_spdlog

Added in version v21.10.00.

Allow projects to find or build spdlog via CPM with built-in tracking of these dependencies for correct export support.

Uses the version of spdlog specified in the version file for consistency across all RAPIDS projects.

rapids_cpm_spdlog( [FMT_OPTION <fmt-option-name>]
                   [BUILD_EXPORT_SET <export-name>]
                   [INSTALL_EXPORT_SET <export-name>]
                   [<CPM_ARGS> ...])

FMT_OPTION .. versionadded:: v23.04.00

Spdlog depends on the fmt library and offers multiple ways of handling this dependency when spdlog is built. This option only controls the behavior when spdlog is fetched and built, NOT when an installed spdlog is found on the system.

This option can be set to: BUNDLED, EXTERNAL_FMT, EXTERNAL_FMT_HO, or STD_FORMAT. If set to BUNDLED, then spdlog will use its own bundled version of fmt. If set to EXTERNAL_FMT then spdlog will use the fmt::fmt target and be linked with the fmt library. If set to EXTERNAL_FMT_HO then spdlog will use the fmt::fmt-header-only target and be linked with a header only fmt library. If set to STD_FORMAT then spdlog will use std::format instead of the fmt library.

Defaults to EXTERNAL_FMT_HO.

BUILD_EXPORT_SET

Record that a CPMFindPackage() for spdlog is required in our build directory export set.

INSTALL_EXPORT_SET

Record that a find_dependency() for spdlog is required in our install directory export set.

Note

Installation of spdlog will occur if an INSTALL_EXPORT_SET is provided, and spdlog is added to the project via add_subdirectory by CPM.

CPM_ARGS

Any arguments after CPM_ARGS will be forwarded to the underlying spdlog CPMFindPackage`() call

Result Targets

spdlog::spdlog, spdlog::spdlog_header_only targets will be created

Result Variables

spdlog_SOURCE_DIR is set to the path to the source directory of spdlog. spdlog_BINARY_DIR is set to the path to the build directory of spdlog. spdlog_ADDED is set to a true value if spdlog has not been added before. spdlog_VERSION is set to the version of spdlog specified by the versions.json. spdlog_fmt_target is set to the fmt target used, if used