From 2d63a28f15b96fa3984a427424f32fd11e19ff2b Mon Sep 17 00:00:00 2001 From: Clinton Stimpson Date: Mon, 16 Oct 2023 15:26:16 -0600 Subject: [PATCH] Find fmt TPL using modern cmake files. --- cmake/TPLs/FindTPLfmt.cmake | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/cmake/TPLs/FindTPLfmt.cmake b/cmake/TPLs/FindTPLfmt.cmake index c6ec212f9e..f749486a22 100644 --- a/cmake/TPLs/FindTPLfmt.cmake +++ b/cmake/TPLs/FindTPLfmt.cmake @@ -53,8 +53,15 @@ # ************************************************************************ # @HEADER +message("-- Using find_package(fmt CONFIG) ...") +find_package(fmt CONFIG) +if (fmt_FOUND) + message("-- Found fmt_CONFIG=${fmt_CONFIG}") + message("-- Generating fmt::all_libs and fmtConfig.cmake") + tribits_extpkg_create_imported_all_libs_target_and_config_file( + fmt + INNER_FIND_PACKAGE_NAME fmt + IMPORTED_TARGETS_FOR_ALL_LIBS fmt::fmt) + set(TPL_fmt_NOT_FOUND FALSE) +endif() -TRIBITS_TPL_FIND_INCLUDE_DIRS_AND_LIBRARIES( fmt - REQUIRED_HEADERS fmt/format.h - REQUIRED_LIBS_NAMES fmt - )