From e5058c1cccce4eed34d2378d327e4c030338d705 Mon Sep 17 00:00:00 2001 From: Larry Gritz Date: Wed, 10 Apr 2024 12:37:37 -0700 Subject: [PATCH] build(deps): Raise OpenVDB minimum to 9.0 (#4218) Soon we'll raise the minimum OpenEXR to 3.1, and OpenVDB 9.0 is the first version to support that. And because OpenVDB has Imath types in its public APIs, it's really hard to mix and match our using an OpenEXR/Imath 3 internal to OIIO with an OpenVDB that uses an OpenEXR/IlmBase 2. --------- Signed-off-by: Larry Gritz --- src/cmake/externalpackages.cmake | 6 +----- src/cmake/modules/FindOpenVDB.cmake | 1 + src/openvdb.imageio/openvdbinput.cpp | 8 +------- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/cmake/externalpackages.cmake b/src/cmake/externalpackages.cmake index a9e8bce32d..2c7f573c4b 100644 --- a/src/cmake/externalpackages.cmake +++ b/src/cmake/externalpackages.cmake @@ -240,13 +240,9 @@ checked_find_package (OpenJPEG VERSION_MIN 2.0 # find them reliable at all, so we stick to our FindOpenJPEG.cmake module. checked_find_package (OpenVDB - VERSION_MIN 5.0 + VERSION_MIN 9.0 DEPS TBB DEFINITIONS -DUSE_OPENVDB=1) -if (OpenVDB_FOUND AND OpenVDB_VERSION VERSION_GREATER_EQUAL 10.1 AND CMAKE_CXX_STANDARD VERSION_LESS 17) - message (WARNING "${ColorYellow}OpenVDB >= 10.1 (we found ${OpenVDB_VERSION}) can only be used when we build with C++17 or higher. Disabling OpenVDB support.${ColorReset}") - set (OpenVDB_FOUND 0) -endif () checked_find_package (Ptex PREFER_CONFIG) if (NOT Ptex_FOUND OR NOT Ptex_VERSION) diff --git a/src/cmake/modules/FindOpenVDB.cmake b/src/cmake/modules/FindOpenVDB.cmake index 4298edd6db..7d9b879565 100644 --- a/src/cmake/modules/FindOpenVDB.cmake +++ b/src/cmake/modules/FindOpenVDB.cmake @@ -78,6 +78,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenVDB ) if (OpenVDB_FOUND) + set (OpenVDB_VERSION ${OPENVDB_VERSION}) set(OPENVDB_LIBRARIES ${OPENVDB_LIBRARY}) set(OPENVDB_INCLUDES ${OPENVDB_INCLUDE_DIR}) diff --git a/src/openvdb.imageio/openvdbinput.cpp b/src/openvdb.imageio/openvdbinput.cpp index 12f0623d4c..6e153cd432 100644 --- a/src/openvdb.imageio/openvdbinput.cpp +++ b/src/openvdb.imageio/openvdbinput.cpp @@ -14,12 +14,6 @@ #include #include -// Try to use the long form/abi version string introduced in 5.0 -#if OPENVDB_LIBRARY_MAJOR_VERSION_NUMBER <= 4 -# define OIIO_OPENVDB_VERSION OPENVDB_LIBRARY_VERSION_STRING -#else -# define OIIO_OPENVDB_VERSION OPENVDB_LIBRARY_ABI_VERSION_STRING -#endif OIIO_PLUGIN_NAMESPACE_BEGIN @@ -598,7 +592,7 @@ OIIO_EXPORT int openvdb_imageio_version = OIIO_PLUGIN_VERSION; OIIO_EXPORT const char* openvdb_imageio_library_version() { - return "OpenVDB " OIIO_OPENVDB_VERSION; + return "OpenVDB " OPENVDB_LIBRARY_ABI_VERSION_STRING; } OIIO_PLUGIN_EXPORTS_END