We're using the vendored fmt lib when there is no system library
available. However, there is an inconsistency: the
WITH_FMT_HEADER_ONLY setting is ignored by the vendored library.
In order to address this, we'll use the fmt-header-only alias
if WITH_FMT_HEADER_ONLY is set.
Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
set(old_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})
set(BUILD_SHARED_LIBS FALSE)
add_subdirectory(fmt)
+ if (WITH_FMT_HEADER_ONLY)
+ add_library(fmt::fmt ALIAS fmt-header-only)
+ endif()
set(BUILD_SHARED_LIBS ${old_BUILD_SHARED_LIBS})
unset(old_BUILD_SHARED_LIBS)
include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/src/fmt/include")