465b852
diff -up PrusaSlicer-version_2.4.0/cmake/modules/FindOpenVDB.cmake.openexr3 PrusaSlicer-version_2.4.0/cmake/modules/FindOpenVDB.cmake
465b852
--- PrusaSlicer-version_2.4.0/cmake/modules/FindOpenVDB.cmake.openexr3	2021-12-21 15:57:35.000000000 +0000
465b852
+++ PrusaSlicer-version_2.4.0/cmake/modules/FindOpenVDB.cmake	2022-02-11 19:27:12.105404186 +0000
465b852
@@ -347,28 +347,10 @@ macro(just_fail msg)
8d0380f
   return()
8d0380f
 endmacro()
8d0380f
 
465b852
-find_package(IlmBase QUIET)
8d0380f
-if(NOT IlmBase_FOUND)
8d0380f
-  pkg_check_modules(IlmBase QUIET IlmBase)
8d0380f
-endif()
8d0380f
-if (IlmBase_FOUND AND NOT TARGET IlmBase::Half)
8d0380f
-  message(STATUS "Falling back to IlmBase found by pkg-config...")
8d0380f
-
8d0380f
-  find_library(IlmHalf_LIBRARY NAMES Half)
8d0380f
-  if(IlmHalf_LIBRARY-NOTFOUND OR NOT IlmBase_INCLUDE_DIRS)
8d0380f
-    just_fail("IlmBase::Half can not be found!")
8d0380f
-  endif()
8d0380f
-  
8d0380f
-  add_library(IlmBase::Half UNKNOWN IMPORTED)
8d0380f
-  set_target_properties(IlmBase::Half PROPERTIES
8d0380f
-    IMPORTED_LOCATION "${IlmHalf_LIBRARY}"
8d0380f
-    INTERFACE_INCLUDE_DIRECTORIES "${IlmBase_INCLUDE_DIRS}")
8d0380f
-elseif(NOT IlmBase_FOUND)
8d0380f
-  just_fail("IlmBase::Half can not be found!")
8d0380f
-endif()
8d0380f
 find_package(TBB ${_quiet} ${_required} COMPONENTS tbb)
8d0380f
 find_package(ZLIB ${_quiet} ${_required})
8d0380f
 find_package(Boost ${_quiet} ${_required} COMPONENTS iostreams system )
8d0380f
+find_package(Imath CONFIG)
8d0380f
 
8d0380f
 # Use GetPrerequisites to see which libraries this OpenVDB lib has linked to
8d0380f
 # which we can query for optional deps. This basically runs ldd/otoll/objdump
465b852
@@ -419,7 +401,7 @@ foreach(PREREQUISITE ${_OPENVDB_PREREQUI
8d0380f
     set(OpenVDB_USES_LOG4CPLUS ON)
8d0380f
   endif()
8d0380f
 
8d0380f
-  string(FIND ${PREREQUISITE} "IlmImf" _HAS_DEP)
8d0380f
+  string(FIND ${PREREQUISITE} "OpenEXR" _HAS_DEP)
8d0380f
   if(NOT ${_HAS_DEP} EQUAL -1)
8d0380f
     set(OpenVDB_USES_ILM ON)
8d0380f
   endif()
465b852
@@ -450,11 +432,7 @@ if(OpenVDB_USES_LOG4CPLUS)
8d0380f
   find_package(Log4cplus ${_quiet} ${_required})
8d0380f
 endif()
8d0380f
 
8d0380f
-if(OpenVDB_USES_ILM)
8d0380f
-  find_package(IlmBase ${_quiet} ${_required})
8d0380f
-endif()
8d0380f
-
8d0380f
-if(OpenVDB_USES_EXR)
8d0380f
+if(OpenVDB_USES_ILM OR OpenVDB_USES_EXR)
8d0380f
   find_package(OpenEXR ${_quiet} ${_required})
8d0380f
 endif()
8d0380f
 
465b852
@@ -471,7 +449,7 @@ endif()
8d0380f
 set(_OPENVDB_VISIBLE_DEPENDENCIES
8d0380f
   Boost::iostreams
8d0380f
   Boost::system
8d0380f
-  IlmBase::Half
8d0380f
+  Imath::Imath
8d0380f
 )
8d0380f
 
8d0380f
 set(_OPENVDB_DEFINITIONS)
465b852
@@ -481,10 +459,7 @@ endif()
8d0380f
 
8d0380f
 if(OpenVDB_USES_EXR)
8d0380f
   list(APPEND _OPENVDB_VISIBLE_DEPENDENCIES
8d0380f
-    IlmBase::IlmThread
8d0380f
-    IlmBase::Iex
8d0380f
-    IlmBase::Imath
8d0380f
-    OpenEXR::IlmImf
8d0380f
+    OpenEXR::OpenEXR
8d0380f
   )
8d0380f
   list(APPEND _OPENVDB_DEFINITIONS "-DOPENVDB_TOOLS_RAYTRACER_USE_EXR")
8d0380f
 endif()