File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -350,7 +350,12 @@ macro (find_or_download_fmt)
350
350
endif ()
351
351
set (FMT_INCLUDE_DIR "${FMT_INSTALL_DIR} /include" )
352
352
set (OIIO_USING_FMT_LOCAL TRUE )
353
- set (fmt_VERSION ${BUILD_FMT_VERSION} )
353
+ file (STRINGS "${FMT_INCLUDE_DIR} /fmt/core.h" TMP REGEX "^#define FMT_VERSION .*$" )
354
+ string (REGEX MATCHALL "[0-9]+" FMT_VERSION_NUMERIC ${TMP} )
355
+ math (EXPR FMT_VERSION_PATCH "${FMT_VERSION_NUMERIC} % 100" )
356
+ math (EXPR FMT_VERSION_MINOR "(${FMT_VERSION_NUMERIC} / 100) % 100" )
357
+ math (EXPR FMT_VERSION_MAJOR "${FMT_VERSION_NUMERIC} / 10000" )
358
+ set (fmt_VERSION "${FMT_VERSION_MAJOR} .${FMT_VERSION_MINOR} .${FMT_VERSION_PATCH} " )
354
359
else ()
355
360
get_target_property (FMT_INCLUDE_DIR fmt::fmt-header-only INTERFACE_INCLUDE_DIRECTORIES )
356
361
set (OIIO_USING_FMT_LOCAL FALSE )
You can’t perform that action at this time.
0 commit comments