--- libfmt.cmake.23	2024-02-02 17:48:45.000000000 +0100
+++ libfmt.cmake	2023-11-19 08:41:55.000000000 +0100
@@ -1,4 +1,4 @@
-INCLUDE (CheckCXXSourceRuns)
+INCLUDE (CheckCXXSourceCompiles)
 INCLUDE (ExternalProject)
 
 SET(WITH_LIBFMT "auto" CACHE STRING
@@ -27,15 +27,17 @@
 MACRO (CHECK_LIBFMT)
   IF(WITH_LIBFMT STREQUAL "system" OR WITH_LIBFMT STREQUAL "auto")
     SET(CMAKE_REQUIRED_INCLUDES ${LIBFMT_INCLUDE_DIR})
-    CHECK_CXX_SOURCE_RUNS(
+    CHECK_CXX_SOURCE_COMPILES(
     "#define FMT_STATIC_THOUSANDS_SEPARATOR ','
      #define FMT_HEADER_ONLY 1
      #include <fmt/format-inl.h>
+     #include <iostream>
      int main() {
-       int answer= 4321;
+       int answer= 42;
        fmt::format_args::format_arg arg=
          fmt::detail::make_arg<fmt::format_context>(answer);
-       return fmt::vformat(\"{:L}\", fmt::format_args(&arg, 1)).compare(\"4,321\");
+         std::cout << fmt::vformat(\"The answer is {}.\",
+                                   fmt::format_args(&arg, 1));
      }" HAVE_SYSTEM_LIBFMT)
     SET(CMAKE_REQUIRED_INCLUDES)
   ENDIF()
