vcpkg/ports/openvdb/0003-fix-cmake.patch
2020-02-11 16:45:01 -08:00

134 lines
4.0 KiB
Diff

diff --git a/CMakeLists.txt b/CMakeLists.txt
index d7c4ff8..123e50f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -302,7 +302,6 @@ if(OPENVDB_INSTALL_CMAKE_MODULES)
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 01a2f04..16b71bb 100644
--- a/cmake/FindOpenVDB.cmake
+++ b/cmake/FindOpenVDB.cmake
@@ -299,7 +299,7 @@ endif()
# Add standard dependencies
find_package(IlmBase REQUIRED COMPONENTS Half)
-find_package(TBB REQUIRED COMPONENTS tbb)
+find_package(TBB CONFIG REQUIRED)
find_package(ZLIB REQUIRED)
if(NOT OPENVDB_USE_STATIC_LIBS)
diff --git a/openvdb/CMakeLists.txt b/openvdb/CMakeLists.txt
index 9501ff1..ab14fd9 100644
--- a/openvdb/CMakeLists.txt
+++ b/openvdb/CMakeLists.txt
@@ -48,6 +48,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)
@@ -76,6 +77,14 @@ if(OPENVDB_FUTURE_DEPRECATION AND FUTURE_MINIMUM_TBB_VERSION)
"is deprecated and will be removed.")
endif()
endif()
+endif()
+
+if(USE_EXR)
+ find_package(IlmBase REQUIRED)
+ find_package(OpenEXR REQUIRED)
+else()
+ find_package(IlmBase REQUIRED COMPONENTS Half)
+endif()
find_package(ZLIB ${MINIMUM_ZLIB_VERSION} REQUIRED)
@@ -127,10 +136,10 @@ if(CONCURRENT_MALLOC STREQUAL "Jemalloc")
message(WARNING "Unable to find Jemalloc, attempting to fall back to TBB malloc.
It is recommended to use Jemalloc for optimum performance."
)
- find_package(TBB ${MINIMUM_TBB_VERSION} REQUIRED COMPONENTS tbbmalloc tbbmalloc_proxy)
+ find_package(TBB CONFIG REQUIRED)
endif()
elseif(CONCURRENT_MALLOC STREQUAL "Tbbmalloc")
- find_package(TBB ${MINIMUM_TBB_VERSION} REQUIRED COMPONENTS tbbmalloc tbbmalloc_proxy)
+ find_package(TBB CONFIG REQUIRED)
endif()
# Set deps. Note that the order here is important. If we're building against
@@ -142,15 +151,15 @@ endif()
set(OPENVDB_CORE_DEPENDENT_LIBS
Boost::iostreams
Boost::system
- IlmBase::Half
+ ${Ilmbase_HALF_LIBRARY}
)
if(USE_EXR)
list(APPEND OPENVDB_CORE_DEPENDENT_LIBS
- IlmBase::IlmThread
- IlmBase::Iex
- IlmBase::Imath
- OpenEXR::IlmImf
+ ${Ilmbase_ILMTHREAD_LIBRARY}
+ ${Ilmbase_IEX_LIBRARY}
+ ${Ilmbase_IMATH_LIBRARY}
+ ${OPENEXR_ILMIMF_LIBRARY}
)
endif()
@@ -162,7 +171,7 @@ endif()
# See FindOpenVDB.cmake
if(USE_BLOSC)
- list(APPEND OPENVDB_CORE_DEPENDENT_LIBS Blosc::blosc)
+ list(APPEND OPENVDB_CORE_DEPENDENT_LIBS ${BLOSC_blosc_LIBRARY})
endif()
list(APPEND OPENVDB_CORE_DEPENDENT_LIBS
@@ -197,7 +206,11 @@ endif()
# @todo Should be target definitions
if(WIN32)
- add_definitions(-D_WIN32 -DNOMINMAX -DOPENVDB_DLL)
+ add_definitions(-D_WIN32 -DNOMINMAX)
+ add_definitions(-D__TBB_NO_IMPLICIT_LINKAGE -D__TBBMALLOC_NO_IMPLICIT_LINKAGE)
+ if (OPENVDB_SHARED)
+ add_definitions(-DOPENEXR_DLL -DOPENVDB_DLL)
+ endif()
endif()
##### Core library configuration
@@ -415,6 +428,7 @@ if(USE_BLOSC)
list(APPEND OPENVDB_CORE_PRIVATE_DEFINES "-DOPENVDB_USE_BLOSC")
endif()
+list(APPEND OPENVDB_CORE_PRIVATE_DEFINES "$<$<CXX_COMPILER_ID:MSVC>:/bigobj>")
# Public defines
if(USE_EXR)
diff --git a/openvdb/cmd/CMakeLists.txt b/openvdb/cmd/CMakeLists.txt
index 1e5ef0d..8e78efe 100644
--- a/openvdb/cmd/CMakeLists.txt
+++ b/openvdb/cmd/CMakeLists.txt
@@ -133,9 +133,9 @@ if(OPENVDB_BUILD_VDB_RENDER)
# headers
target_link_libraries(vdb_render
- OpenEXR::IlmImf
- IlmBase::IlmThread
- IlmBase::Iex
+ ${OPENEXR_ILMIMF_LIBRARY}
+ ${Ilmbase_ILMTHREAD_LIBRARY}
+ ${Ilmbase_IEX_LIBRARY}
${OPENVDB_BINARIES_DEPENDENT_LIBS}
)