Skip to content

Instantly share code, notes, and snippets.

@Athemis
Created August 6, 2021 15:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Athemis/c5858adaee16fc804690cb10b875a369 to your computer and use it in GitHub Desktop.
Save Athemis/c5858adaee16fc804690cb10b875a369 to your computer and use it in GitHub Desktop.
diff --unified --recursive --text package.orig/cmake/modules/FindOpenVDB.cmake package.new/cmake/modules/FindOpenVDB.cmake
--- package.orig/cmake/modules/FindOpenVDB.cmake 2021-08-06 17:45:11.124209585 +0200
+++ package.new/cmake/modules/FindOpenVDB.cmake 2021-08-06 17:47:33.540203622 +0200
@@ -260,7 +260,7 @@
endif ()
list(FIND CMAKE_CONFIGURATION_TYPES "Debug" _has_debug)
-
+
if(OpenVDB_${COMPONENT}_LIBRARY_RELEASE AND (NOT MSVC OR _has_debug LESS 0 OR OpenVDB_${COMPONENT}_LIBRARY_DEBUG))
set(OpenVDB_${COMPONENT}_FOUND TRUE)
else()
@@ -347,28 +347,10 @@
return()
endmacro()
-find_package(IlmBase QUIET)
-if(NOT IlmBase_FOUND)
- pkg_check_modules(IlmBase QUIET IlmBase)
-endif()
-if (IlmBase_FOUND AND NOT TARGET IlmBase::Half)
- message(STATUS "Falling back to IlmBase found by pkg-config...")
-
- find_library(IlmHalf_LIBRARY NAMES Half)
- if(IlmHalf_LIBRARY-NOTFOUND OR NOT IlmBase_INCLUDE_DIRS)
- just_fail("IlmBase::Half can not be found!")
- endif()
-
- add_library(IlmBase::Half UNKNOWN IMPORTED)
- set_target_properties(IlmBase::Half PROPERTIES
- IMPORTED_LOCATION "${IlmHalf_LIBRARY}"
- INTERFACE_INCLUDE_DIRECTORIES "${IlmBase_INCLUDE_DIRS}")
-elseif(NOT IlmBase_FOUND)
- just_fail("IlmBase::Half can not be found!")
-endif()
find_package(TBB ${_quiet} ${_required} COMPONENTS tbb)
find_package(ZLIB ${_quiet} ${_required})
find_package(Boost ${_quiet} ${_required} COMPONENTS iostreams system )
+find_package(Imath CONFIG)
# Use GetPrerequisites to see which libraries this OpenVDB lib has linked to
# which we can query for optional deps. This basically runs ldd/otoll/objdump
@@ -419,7 +401,7 @@
set(OpenVDB_USES_LOG4CPLUS ON)
endif()
- string(FIND ${PREREQUISITE} "IlmImf" _HAS_DEP)
+ string(FIND ${PREREQUISITE} "OpenEXR" _HAS_DEP)
if(NOT ${_HAS_DEP} EQUAL -1)
set(OpenVDB_USES_ILM ON)
endif()
@@ -430,14 +412,14 @@
if(OpenVDB_USES_BLOSC)
find_package(Blosc QUIET)
- if(NOT Blosc_FOUND OR NOT TARGET Blosc::blosc)
+ if(NOT Blosc_FOUND OR NOT TARGET Blosc::blosc)
message(STATUS "find_package could not find Blosc. Using fallback blosc search...")
find_path(Blosc_INCLUDE_DIR blosc.h)
find_library(Blosc_LIBRARY NAMES blosc)
if (Blosc_INCLUDE_DIR AND Blosc_LIBRARY)
set(Blosc_FOUND TRUE)
add_library(Blosc::blosc UNKNOWN IMPORTED)
- set_target_properties(Blosc::blosc PROPERTIES
+ set_target_properties(Blosc::blosc PROPERTIES
IMPORTED_LOCATION "${Blosc_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES ${Blosc_INCLUDE_DIR})
elseif()
@@ -450,10 +432,6 @@
find_package(Log4cplus ${_quiet} ${_required})
endif()
-if(OpenVDB_USES_ILM)
- find_package(IlmBase ${_quiet} ${_required})
-endif()
-
if(OpenVDB_USES_EXR)
find_package(OpenEXR ${_quiet} ${_required})
endif()
@@ -471,7 +449,7 @@
set(_OPENVDB_VISIBLE_DEPENDENCIES
Boost::iostreams
Boost::system
- IlmBase::Half
+ Imath::Imath
)
set(_OPENVDB_DEFINITIONS)
@@ -481,10 +459,7 @@
if(OpenVDB_USES_EXR)
list(APPEND _OPENVDB_VISIBLE_DEPENDENCIES
- IlmBase::IlmThread
- IlmBase::Iex
- IlmBase::Imath
- OpenEXR::IlmImf
+ OpenEXR::OpenEXR
)
list(APPEND _OPENVDB_DEFINITIONS "-DOPENVDB_TOOLS_RAYTRACER_USE_EXR")
endif()
@@ -560,14 +535,14 @@
)
if (_is_multi)
- set_target_properties(OpenVDB::${COMPONENT} PROPERTIES
+ set_target_properties(OpenVDB::${COMPONENT} PROPERTIES
IMPORTED_LOCATION_RELEASE "${OpenVDB_${COMPONENT}_LIBRARY_RELEASE}"
)
if (MSVC OR OpenVDB_${COMPONENT}_LIBRARY_DEBUG)
- set_target_properties(OpenVDB::${COMPONENT} PROPERTIES
+ set_target_properties(OpenVDB::${COMPONENT} PROPERTIES
IMPORTED_LOCATION_DEBUG "${OpenVDB_${COMPONENT}_LIBRARY_DEBUG}"
- )
+ )
endif ()
endif ()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment