Skip to content

Commit

Permalink
build(deps): Account for header changes in fmt project trunk (Academy…
Browse files Browse the repository at this point in the history
…SoftwareFoundation#4109)

Fixes a CI breakage

Signed-off-by: Larry Gritz <lg@larrygritz.com>
  • Loading branch information
lgritz committed Jan 17, 2024
1 parent 3ba9c7c commit b9210fe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/cmake/externalpackages.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
3 changes: 3 additions & 0 deletions src/include/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down

0 comments on commit b9210fe

Please sign in to comment.