Skip to content

Commit

Permalink
When built with SPDLOG_FMT_EXTERNAL_HO consumers of the spdlog target…
Browse files Browse the repository at this point in the history
…s depend on fmt

The cmake/spdlogConfig.cmake.in file properly takes into account the fmt
package dependency when building with SPDLOG_FMT_EXTERNAL:BOOL=ON but
not when built with SPDLOG_FMT_EXTERNAL_HO:BOOL=ON.

Prior to these changes SPDLOG_FMT_EXTERNAL_HO:BOOL=ON results in
exported targets with INTERFACE_LINK_LIBRARIES that contain
fmt::fmt-header-only.

As such, the installed spdlogConfig.cmake file should attempt to find
that dependency for the consumer.
  • Loading branch information
adamcalhoon committed Mar 6, 2022
1 parent 2f2d04b commit 69cac81
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cmake/spdlogConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@
find_package(Threads REQUIRED)

set(SPDLOG_FMT_EXTERNAL @SPDLOG_FMT_EXTERNAL@)
set(SPDLOG_FMT_EXTERNAL_HO @SPDLOG_FMT_EXTERNAL_HO@)
set(config_targets_file @config_targets_file@)

if(SPDLOG_FMT_EXTERNAL)
if(SPDLOG_FMT_EXTERNAL OR SPDLOG_FMT_EXTERNAL_HO)
include(CMakeFindDependencyMacro)
find_dependency(fmt CONFIG)
endif()


include("${CMAKE_CURRENT_LIST_DIR}/${config_targets_file}")

check_required_components(spdlog)
check_required_components(spdlog)

0 comments on commit 69cac81

Please sign in to comment.