Skip to content

Commit

Permalink
fix: ensure bundled fmt includes have priority over system/homebrew
Browse files Browse the repository at this point in the history
  • Loading branch information
maxirmx committed Aug 30, 2024
1 parent bd91c9d commit c7acb10
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -358,6 +357,12 @@ else(PREFER_SYSTEM_LIBFMT)
)
FetchContent_MakeAvailable(fmt)

target_include_directories(fmt BEFORE PUBLIC
$<BUILD_INTERFACE:${fmt_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)

include_directories(BEFORE ${fmt_SOURCE_DIR}/include)
endif(PREFER_SYSTEM_LIBFMT)

find_package(Boost 1.67 REQUIRED COMPONENTS chrono iostreams program_options)
Expand Down

0 comments on commit c7acb10

Please sign in to comment.