diff --git a/src/cmake/externalpackages.cmake b/src/cmake/externalpackages.cmake index 4674444911..ab559f1308 100644 --- a/src/cmake/externalpackages.cmake +++ b/src/cmake/externalpackages.cmake @@ -350,7 +350,11 @@ macro (find_or_download_fmt) endif () set (FMT_INCLUDE_DIR "${FMT_INSTALL_DIR}/include") set (OIIO_USING_FMT_LOCAL TRUE) - file (STRINGS "${FMT_INCLUDE_DIR}/fmt/core.h" TMP REGEX "^#define FMT_VERSION .*$") + if (EXISTS "${FMT_INCLUDE_DIR}/fmt/base.h") + file (STRINGS "${FMT_INCLUDE_DIR}/fmt/base.h" TMP REGEX "^#define FMT_VERSION .*$") + else () + file (STRINGS "${FMT_INCLUDE_DIR}/fmt/core.h" TMP REGEX "^#define FMT_VERSION .*$") + endif () string (REGEX MATCHALL "[0-9]+" FMT_VERSION_NUMERIC ${TMP}) math(EXPR FMT_VERSION_PATCH "${FMT_VERSION_NUMERIC} % 100") math(EXPR FMT_VERSION_MINOR "(${FMT_VERSION_NUMERIC} / 100) % 100") diff --git a/src/include/CMakeLists.txt b/src/include/CMakeLists.txt index 98ba2dc246..6daf970234 100644 --- a/src/include/CMakeLists.txt +++ b/src/include/CMakeLists.txt @@ -69,6 +69,9 @@ if (INTERNALIZE_FMT OR OIIO_USING_FMT_LOCAL) if (fmt_VERSION VERSION_GREATER_EQUAL 9) list (APPEND fmt_headers_base_names std.h) endif () + if (EXISTS "${FMT_INCLUDE_DIR}/fmt/base.h") + list (APPEND fmt_headers_base_names base.h) + endif () set (fmt_internal_directory ${CMAKE_BINARY_DIR}/include/OpenImageIO/detail/fmt) list (TRANSFORM fmt_headers_base_names PREPEND ${FMT_INCLUDE_DIR}/fmt/