This is an automated email from the ASF dual-hosted git repository.
mgrigorov pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/avro.git
The following commit(s) were added to refs/heads/main by this push:
new 7543169105 AVRO-4171: [c++] find system installed fmt first (#3447)
7543169105 is described below
commit 7543169105ff3331c3bc9a13b96e38f2361ad0b9
Author: Daeho Ro <[email protected]>
AuthorDate: Tue Aug 5 05:06:15 2025 +0900
AVRO-4171: [c++] find system installed fmt first (#3447)
---
lang/c++/CMakeLists.txt | 21 ++++++++++++---------
1 file changed, 12 insertions(+), 9 deletions(-)
diff --git a/lang/c++/CMakeLists.txt b/lang/c++/CMakeLists.txt
index 289daf9137..6bdef2da84 100644
--- a/lang/c++/CMakeLists.txt
+++ b/lang/c++/CMakeLists.txt
@@ -79,15 +79,18 @@ if (AVRO_BUILD_TESTS OR AVRO_USE_BOOST)
find_package (Boost 1.70 REQUIRED CONFIG COMPONENTS system)
endif ()
-include(FetchContent)
-FetchContent_Declare(
- fmt
- GIT_REPOSITORY https://github.com/fmtlib/fmt.git
- GIT_TAG 10.2.1
- GIT_PROGRESS TRUE
- USES_TERMINAL_DOWNLOAD TRUE
-)
-FetchContent_MakeAvailable(fmt)
+find_package(fmt)
+if (NOT fmt_FOUND)
+ include(FetchContent)
+ FetchContent_Declare(
+ fmt
+ GIT_REPOSITORY https://github.com/fmtlib/fmt.git
+ GIT_TAG 10.2.1
+ GIT_PROGRESS TRUE
+ USES_TERMINAL_DOWNLOAD TRUE
+ )
+ FetchContent_MakeAvailable(fmt)
+endif ()
find_package(Snappy CONFIG)
if (Snappy_FOUND)