Fix T54457: build error with OpenVDB versions newer than 3.
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Thu, 29 Mar 2018 05:20:16 +0000 (07:20 +0200)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Thu, 29 Mar 2018 05:21:35 +0000 (07:21 +0200)
Solution provided by Sven-Hendrik Haase.

intern/openvdb/CMakeLists.txt
intern/openvdb/intern/openvdb_writer.cc

index e0ecdb5..4b872f2 100644 (file)
@@ -38,6 +38,7 @@ set(SRC
 if(WITH_OPENVDB)
        add_definitions(
                -DWITH_OPENVDB
+               -DOPENVDB_3_ABI_COMPATIBLE
        )
 
        list(APPEND INC_SYS
index e886c5a..b83691a 100644 (file)
@@ -45,7 +45,7 @@ void OpenVDBWriter::insert(const openvdb::GridBase::Ptr &grid)
 
 void OpenVDBWriter::insert(const openvdb::GridBase &grid)
 {
-#if (OPENVDB_LIBRARY_MAJOR_VERSION_NUMBER == 3)
+#if (OPENVDB_LIBRARY_MAJOR_VERSION_NUMBER >= 3)
        m_grids->push_back(grid.copyGrid());
 #else
        m_grids->push_back(grid.copyGridWithNewTree());