From af12c25d6da4b2b1f87c44caf85f02d42262085d Mon Sep 17 00:00:00 2001 From: Don Rolih Date: Wed, 23 Oct 2024 17:34:55 -0400 Subject: [PATCH] [cmake] Check if fmt is already a target --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a26de726..745a0a5d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -197,7 +197,10 @@ CPMAddPackage( ) # fmt -CPMAddPackage("gh:fmtlib/fmt#11.0.2") +# Check if fmt is already a target; important when using as an outside library in nrgljubljana_interface +if (NOT TARGET fmt::fmt) + CPMAddPackage("gh:fmtlib/fmt#11.0.2") +endif() # range-v3 CPMAddPackage("gh:ericniebler/range-v3#0.12.0")