Allow using system libfmt

Signed-off-by: Jean-Pierre De Jesus DIAZ <me@jeandudey.tech>
This commit is contained in:
Jean-Pierre De Jesus DIAZ 2023-05-29 14:09:58 +02:00
parent 65fc16d5ac
commit 0399b6b6bb
No known key found for this signature in database
GPG key ID: 6279AEC20A9524EC
46 changed files with 32 additions and 15 deletions

14
cmake/fmt.cmake Normal file
View file

@ -0,0 +1,14 @@
# 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()