Allow using libfmt system package

This commit is contained in:
Zachary Hall 2024-09-28 11:19:41 -07:00
parent 175cb703f1
commit 6f08458f63

View file

@ -40,6 +40,7 @@ set(JSONCPP_WITH_PKGCONFIG_SUPPORT OFF CACHE BOOL "" FORCE)
set(JSONCPP_WITH_CMAKE_PACKAGE OFF CACHE BOOL "" FORCE) set(JSONCPP_WITH_CMAKE_PACKAGE OFF CACHE BOOL "" FORCE)
option(ENABLE_DBUS "Enables DBus support" ON) option(ENABLE_DBUS "Enables DBus support" ON)
option(USE_PORTALS "Enables libportal" ON) option(USE_PORTALS "Enables libportal" ON)
option(BUILD_LIBFMT "Builds libfmt" OFF)
if (DEFINED EMSCRIPTEN) if (DEFINED EMSCRIPTEN)
option(FOR_WASMER "Enables support for wasmer" OFF) option(FOR_WASMER "Enables support for wasmer" OFF)
set(BUILD_STATIC ON CACHE BOOL "" FORCE) 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) #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}) set(DEBUG_MODE_VALUE ${DEBUG})
configure_file(config.cmake.h.in config.h) configure_file(config.cmake.h.in config.h)
if (BUILD_FMT)
add_subdirectory(subprojects/fmt) add_subdirectory(subprojects/fmt)
else()
find_package(fmt)
endif()
macro(target_pkgconfig) macro(target_pkgconfig)
push_fnstack("target_pkgconfig") push_fnstack("target_pkgconfig")
cmake_parse_arguments(PARSED_ARGS "OPTIONAL;PRIVATE;PUBLIC;INTERFACE" "PREFIX" "TARGETS;LIBRARIES" ${ARGN}) cmake_parse_arguments(PARSED_ARGS "OPTIONAL;PRIVATE;PUBLIC;INTERFACE" "PREFIX" "TARGETS;LIBRARIES" ${ARGN})