REDACTED-rig/cmake/fmt.cmake
Jean-Pierre De Jesus DIAZ 0399b6b6bb
Allow using system libfmt
Signed-off-by: Jean-Pierre De Jesus DIAZ <me@jeandudey.tech>
2023-05-29 20:15:44 +02:00

14 lines
493 B
CMake

# SPDX-FileCopyrightText: © 2023 Jean-Pierre De Jesus DIAZ <me@jeandudey.tech>
# SPDX-License-Identifier: GPL-3.0-or-later
find_package(fmt QUIET)
if(fmt_FOUND)
set(FMT_LIBRARY fmt::fmt)
else()
message(STATUS "Using bundled fmt library")
add_library(fmt INTERFACE)
target_sources(fmt INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/src/3rdparty/fmt/format.cc)
target_include_directories(fmt INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/src/3rdparty/fmt)
set(FMT_LIBRARY fmt)
endif()