From 19e01f7255e2c433b700237e4592fc5d6cf752e8 Mon Sep 17 00:00:00 2001 From: "Jason E. Hale" Date: Fri, 18 Aug 2023 10:18:50 -0400 Subject: [PATCH] BUILD(cmake): Fix detection of unbundled GSL Microsoft.GSL exports the Microsoft.GSL::GSL target. If the namespace isn't specified, the detection moves on the else() block, and while it still gets detected by FindMSGSL.cmake, a false warning is emitted saying that the version is less than 3.0. --- src/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5d815533af..0bd281cc5a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -217,8 +217,8 @@ else() # GSL since version 3) find_pkg("Microsoft.GSL") - if (TARGET GSL) - target_link_libraries(shared PUBLIC GSL) + if (TARGET Microsoft.GSL::GSL) + target_link_libraries(shared PUBLIC Microsoft.GSL::GSL) else() # If the above failed, it could mean that there is an installation of GSL < v3.0 on this system, which does not yet # provide cmake support for finding it. Thus, we have to use our custom Find-script.