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})