From 421bf61fee35cb8158b4e7ee8a8e40a4089554d9 Mon Sep 17 00:00:00 2001 From: Adam Emerson Date: Sat, 28 Oct 2023 13:42:59 -0400 Subject: [PATCH] build: Add `WITH_SYSTEM_FMT` option The `WITH_SYSTEM_FMT` option builds against system fmt and will fail if a suitable version is not found. It is defaulted to `OFF`. Signed-off-by: Adam Emerson --- src/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index deb27a1c36c..dca5e6e6d4a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -326,7 +326,10 @@ if(NOT TARGET RapidJSON::RapidJSON) endif() option(WITH_FMT_HEADER_ONLY "use header-only version of fmt library" OFF) -find_package(fmt 8.1.1...<10.0.0) +option(WITH_SYSTEM_FMT "build against system fmt" OFF) +if(WITH_SYSTEM_FMT) + find_package(fmt 8.1.1...<10.0.0 REQUIRED) +endif() if(fmt_FOUND) message(STATUS "Building with system fmt.") if (WITH_FMT_HEADER_ONLY) -- 2.47.3