From 6f08458f6352a31fff0a2d59c3b96d52064bab13 Mon Sep 17 00:00:00 2001 From: Zachary Hall Date: Sat, 28 Sep 2024 11:19:41 -0700 Subject: [PATCH] Allow using libfmt system package --- CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2962387..7cf4a15 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,6 +40,7 @@ set(JSONCPP_WITH_PKGCONFIG_SUPPORT OFF CACHE BOOL "" FORCE) set(JSONCPP_WITH_CMAKE_PACKAGE OFF CACHE BOOL "" FORCE) option(ENABLE_DBUS "Enables DBus support" ON) option(USE_PORTALS "Enables libportal" ON) +option(BUILD_LIBFMT "Builds libfmt" OFF) if (DEFINED EMSCRIPTEN) option(FOR_WASMER "Enables support for wasmer" OFF) set(BUILD_STATIC ON CACHE BOOL "" FORCE) @@ -172,7 +173,11 @@ include(log) #execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/meson2cmake_cfg.py ${CMAKE_CURRENT_SOURCE_DIR}/config.meson.h.in ${CMAKE_CURRENT_SOURCE_DIR}/config.cmake.h.in) set(DEBUG_MODE_VALUE ${DEBUG}) configure_file(config.cmake.h.in config.h) -add_subdirectory(subprojects/fmt) +if (BUILD_FMT) + add_subdirectory(subprojects/fmt) +else() + find_package(fmt) +endif() macro(target_pkgconfig) push_fnstack("target_pkgconfig") cmake_parse_arguments(PARSED_ARGS "OPTIONAL;PRIVATE;PUBLIC;INTERFACE" "PREFIX" "TARGETS;LIBRARIES" ${ARGN})