Skip to content

Commit

Permalink
build(deps): Raise OpenVDB minimum to 9.0 (#4218)
Browse files Browse the repository at this point in the history
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 <lg@larrygritz.com>
  • Loading branch information
lgritz authored Apr 10, 2024
1 parent 5472c84 commit e5058c1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 12 deletions.
6 changes: 1 addition & 5 deletions src/cmake/externalpackages.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions src/cmake/modules/FindOpenVDB.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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})

Expand Down
8 changes: 1 addition & 7 deletions src/openvdb.imageio/openvdbinput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@
#include <openvdb/openvdb.h>
#include <openvdb/tools/Dense.h>

// 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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit e5058c1

Please sign in to comment.