Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
MDBF-348: libfmt=system, custom include path
With testing the system libfmt, use the
LIBFMT_INCLUDE_DIR in case the system
include path isn't sufficient.
  • Loading branch information
grooverdan committed Apr 1, 2022
1 parent f78fdf0 commit 38c9c07
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cmake/libfmt.cmake
Expand Up @@ -26,6 +26,7 @@ ENDMACRO()

MACRO (CHECK_LIBFMT)
IF(WITH_LIBFMT STREQUAL "system" OR WITH_LIBFMT STREQUAL "auto")
SET(CMAKE_REQUIRED_INCLUDES ${LIBFMT_INCLUDE_DIR})
CHECK_CXX_SOURCE_COMPILES(
"#define FMT_STATIC_THOUSANDS_SEPARATOR ','
#define FMT_HEADER_ONLY 1
Expand All @@ -37,6 +38,7 @@ MACRO (CHECK_LIBFMT)
std::cout << fmt::vformat(\"The answer is {}.\",
fmt::format_args(&arg, 1));
}" HAVE_SYSTEM_LIBFMT)
SET(CMAKE_REQUIRED_INCLUDES)
ENDIF()
IF(NOT HAVE_SYSTEM_LIBFMT OR WITH_LIBFMT STREQUAL "bundled")
IF (WITH_LIBFMT STREQUAL "system")
Expand Down

0 comments on commit 38c9c07

Please sign in to comment.