From 01f0f578fc83c833e8170c2217528c557ad170ba Mon Sep 17 00:00:00 2001 From: maxirmx Date: Sat, 31 Aug 2024 01:32:17 +0300 Subject: [PATCH] fix: ensure bundled fmt includes have priority over system/homebrew --- CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 85c9f993..8b035d12 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -347,7 +347,6 @@ endif() if(PREFER_SYSTEM_LIBFMT) find_package(fmt 10 CONFIG) else(PREFER_SYSTEM_LIBFMT) - include_directories(${fmt_SOURCE_DIR}/include) include(FetchContent) FetchContent_Declare( @@ -358,6 +357,12 @@ else(PREFER_SYSTEM_LIBFMT) ) FetchContent_MakeAvailable(fmt) + target_include_directories(fmt BEFORE PUBLIC + $ + $ + ) + + include_directories(BEFORE ${fmt_SOURCE_DIR}/include) endif(PREFER_SYSTEM_LIBFMT) find_package(Boost 1.67 REQUIRED COMPONENTS chrono iostreams program_options)