vcpkg/ports/openvdb/0003-fix-cmake.patch
2021-07-16 00:48:26 -07:00

148 lines
5.0 KiB
Diff

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 93a65c7..24ec864 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -338,13 +338,9 @@ endif()
if(OPENVDB_INSTALL_CMAKE_MODULES)
set(OPENVDB_CMAKE_MODULES
- cmake/FindBlosc.cmake
cmake/FindJemalloc.cmake
- cmake/FindIlmBase.cmake
cmake/FindLog4cplus.cmake
- cmake/FindOpenEXR.cmake
cmake/FindOpenVDB.cmake
- cmake/FindTBB.cmake
cmake/OpenVDBGLFW3Setup.cmake
cmake/OpenVDBHoudiniSetup.cmake
cmake/OpenVDBMayaSetup.cmake
diff --git a/cmake/FindOpenVDB.cmake b/cmake/FindOpenVDB.cmake
index 219b90a..b280f85 100644
--- a/cmake/FindOpenVDB.cmake
+++ b/cmake/FindOpenVDB.cmake
@@ -448,8 +448,8 @@ endif()
# Add standard dependencies
-find_package(IlmBase REQUIRED COMPONENTS Half)
-find_package(TBB REQUIRED COMPONENTS tbb)
+find_package(IlmBase CONFIG REQUIRED)
+find_package(TBB CONFIG REQUIRED)
find_package(ZLIB REQUIRED)
if(NOT OPENVDB_USE_STATIC_LIBS AND NOT Boost_USE_STATIC_LIBS)
@@ -588,7 +588,7 @@ else()
endif()
if(OpenVDB_USES_BLOSC)
- find_package(Blosc REQUIRED)
+ find_package(blosc CONFIG REQUIRED)
endif()
if(OpenVDB_USES_ZLIB)
@@ -602,6 +602,8 @@ endif()
if(OpenVDB_USES_EXR)
find_package(IlmBase REQUIRED)
find_package(OpenEXR REQUIRED)
+ find_package(IlmBase CONFIG REQUIRED)
+ find_package(OpenEXR CONFIG REQUIRED)
endif()
if(UNIX)
@@ -662,7 +664,7 @@ set(_OPENVDB_HIDDEN_DEPENDENCIES)
if(NOT OPENVDB_USE_STATIC_LIBS)
if(OpenVDB_USES_BLOSC)
- list(APPEND _OPENVDB_HIDDEN_DEPENDENCIES Blosc::blosc)
+ list(APPEND _OPENVDB_HIDDEN_DEPENDENCIES blosc)
endif()
if(OpenVDB_USES_ZLIB)
list(APPEND _OPENVDB_HIDDEN_DEPENDENCIES ZLIB::ZLIB)
diff --git a/openvdb/openvdb/CMakeLists.txt b/openvdb/openvdb/CMakeLists.txt
index 536bf1e..568fec1 100644
--- a/openvdb/openvdb/CMakeLists.txt
+++ b/openvdb/openvdb/CMakeLists.txt
@@ -47,7 +47,7 @@ message(STATUS "----------------------------------------------------")
##########################################################################
# Collect and configure lib dependencies
-
+if(0)
if(USE_EXR)
find_package(IlmBase ${MINIMUM_ILMBASE_VERSION} REQUIRED)
find_package(OpenEXR ${MINIMUM_OPENEXR_VERSION} REQUIRED)
@@ -57,8 +57,14 @@ if(USE_EXR)
"is deprecated and will be removed.")
endif()
endif()
+endif()
+endif()
+
+if(USE_EXR)
+ find_package(IlmBase CONFIG REQUIRED)
+ find_package(OpenEXR CONFIG REQUIRED)
else()
- find_package(IlmBase ${MINIMUM_ILMBASE_VERSION} REQUIRED COMPONENTS Half)
+ find_package(IlmBase CONFIG REQUIRED)
endif()
if(OPENVDB_FUTURE_DEPRECATION AND FUTURE_MINIMUM_ILMBASE_VERSION)
@@ -68,7 +74,7 @@ if(OPENVDB_FUTURE_DEPRECATION AND FUTURE_MINIMUM_ILMBASE_VERSION)
endif()
endif()
-find_package(TBB ${MINIMUM_TBB_VERSION} REQUIRED COMPONENTS tbb)
+find_package(TBB CONFIG REQUIRED)
if(OPENVDB_FUTURE_DEPRECATION AND FUTURE_MINIMUM_TBB_VERSION)
if(${Tbb_VERSION} VERSION_LESS FUTURE_MINIMUM_TBB_VERSION)
@@ -82,14 +88,7 @@ if(USE_LOG4CPLUS)
endif()
if(USE_BLOSC)
- find_package(Blosc ${MINIMUM_BLOSC_VERSION} REQUIRED)
- if(Blosc_FOUND AND Blosc_VERSION VERSION_GREATER MINIMUM_BLOSC_VERSION)
- message(WARNING "The version of Blosc located is greater than ${MINIMUM_BLOSC_VERSION}. "
- "There have been reported issues with using later versions of Blosc with OpenVDB. "
- "OpenVDB has been tested fully against Blosc ${MINIMUM_BLOSC_VERSION}, it is "
- "recommended that you use this version where possible."
- )
- endif()
+ find_package(blosc CONFIG REQUIRED)
else()
message(WARNING "Blosc support is disabled. It is strongly recommended to "
"enable blosc for optimal builds of OpenVDB and to support compatible "
@@ -165,7 +164,7 @@ endif()
# See FindOpenVDB.cmake
if(USE_BLOSC)
- list(APPEND OPENVDB_CORE_DEPENDENT_LIBS Blosc::blosc)
+ list(APPEND OPENVDB_CORE_DEPENDENT_LIBS blosc)
endif()
if(USE_BLOSC OR USE_ZLIB)
diff --git a/openvdb/openvdb/cmd/CMakeLists.txt b/openvdb/openvdb/cmd/CMakeLists.txt
index ba78f4b..461fd2f 100644
--- a/openvdb/openvdb/cmd/CMakeLists.txt
+++ b/openvdb/openvdb/cmd/CMakeLists.txt
@@ -50,7 +50,7 @@ if(CONCURRENT_MALLOC STREQUAL "Jemalloc")
find_package(Jemalloc REQUIRED)
list(APPEND OPENVDB_BINARIES_DEPENDENT_LIBS Jemalloc::jemalloc)
elseif(CONCURRENT_MALLOC STREQUAL "Tbbmalloc")
- find_package(TBB ${MINIMUM_TBB_VERSION} REQUIRED COMPONENTS tbbmalloc)
+ find_package(TBB CONFIG REQUIRED)
list(APPEND OPENVDB_BINARIES_DEPENDENT_LIBS TBB::tbbmalloc)
endif()
@@ -120,8 +120,8 @@ endif()
#### vdb_render
if(OPENVDB_BUILD_VDB_RENDER)
- find_package(IlmBase ${MINIMUM_ILMBASE_VERSION} REQUIRED COMPONENTS Half Iex IlmThread Imath)
- find_package(OpenEXR ${MINIMUM_OPENEXR_VERSION} REQUIRED COMPONENTS IlmImf)
+ find_package(IlmBase CONFIG REQUIRED)
+ find_package(OpenEXR CONFIG REQUIRED)
set(VDB_RENDER_SOURCE_FILES openvdb_render.cc)
add_executable(vdb_render ${VDB_RENDER_SOURCE_FILES})