From 0d41777cea1720cdf3fc54e182325b4440b08d40 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sun, 18 Dec 2022 10:47:42 +0800 Subject: [PATCH] cmake: set WITH_FMT_VERSION as a STRING option option() defines a boolean, so its default value cannot be populated to find_package() as expected. so we need to set it as a cached STRING variable. this addresses the regression introduced by 051ec194df16927187cbe4b26dacd06c31fa186a Signed-off-by: Kefu Chai --- src/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f29d173b3cdf..e3aa15f4638e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -321,7 +321,8 @@ if(NOT TARGET RapidJSON::RapidJSON) endif() option(WITH_FMT_HEADER_ONLY "use header-only version of fmt library" OFF) -option(WITH_FMT_VERSION "build with fmt version" 7.0.0) +set(WITH_FMT_VERSION "7.0.0" CACHE + STRING "build with fmt version") find_package(fmt ${WITH_FMT_VERSION} QUIET) if(fmt_FOUND) include_directories(SYSTEM "${fmt_INCLUDE_DIR}") -- 2.47.3