[openvdb] Update to the latest version (#13740)

* [openvdb] Update to the latest version

* Update tools

Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
This commit is contained in:
NancyLi1013 2020-10-14 07:21:27 +08:00 committed by GitHub
parent a8ac019a32
commit cb3352bbff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 86 additions and 613 deletions

View File

@ -1,145 +0,0 @@
diff --git a/cmake/FindBlosc.cmake b/cmake/FindBlosc.cmake
index cc80fc5..3ead1b3 100644
--- a/cmake/FindBlosc.cmake
+++ b/cmake/FindBlosc.cmake
@@ -99,13 +99,6 @@ elseif(DEFINED ENV{BLOSC_ROOT})
set(_BLOSC_ROOT $ENV{BLOSC_ROOT})
endif()
-# Additionally try and use pkconfig to find blosc
-
-if(NOT DEFINED PKG_CONFIG_FOUND)
- find_package(PkgConfig)
-endif()
-pkg_check_modules(PC_Blosc QUIET blosc)
-
# ------------------------------------------------------------------------
# Search for blosc include DIR
# ------------------------------------------------------------------------
diff --git a/cmake/FindCppUnit.cmake b/cmake/FindCppUnit.cmake
index af121ba..8fda97c 100644
--- a/cmake/FindCppUnit.cmake
+++ b/cmake/FindCppUnit.cmake
@@ -101,13 +101,6 @@ elseif(DEFINED ENV{CPPUNIT_ROOT})
set(_CPPUNIT_ROOT $ENV{CPPUNIT_ROOT})
endif()
-# Additionally try and use pkconfig to find cppunit
-
-if(NOT DEFINED PKG_CONFIG_FOUND)
- find_package(PkgConfig)
-endif()
-pkg_check_modules(PC_CppUnit QUIET cppunit)
-
# ------------------------------------------------------------------------
# Search for CppUnit include DIR
# ------------------------------------------------------------------------
diff --git a/cmake/FindIlmBase.cmake b/cmake/FindIlmBase.cmake
index f20f803..00a6d30 100644
--- a/cmake/FindIlmBase.cmake
+++ b/cmake/FindIlmBase.cmake
@@ -142,13 +142,6 @@ elseif(DEFINED ENV{ILMBASE_ROOT})
set(_ILMBASE_ROOT $ENV{ILMBASE_ROOT})
endif()
-# Additionally try and use pkconfig to find IlmBase
-
-if(NOT DEFINED PKG_CONFIG_FOUND)
- find_package(PkgConfig)
-endif()
-pkg_check_modules(PC_IlmBase QUIET IlmBase)
-
# ------------------------------------------------------------------------
# Search for IlmBase include DIR
# ------------------------------------------------------------------------
diff --git a/cmake/FindLog4cplus.cmake b/cmake/FindLog4cplus.cmake
index f11472e..f7388d4 100644
--- a/cmake/FindLog4cplus.cmake
+++ b/cmake/FindLog4cplus.cmake
@@ -101,13 +101,6 @@ elseif(DEFINED ENV{LOG4CPLUS_ROOT})
set(_LOG4CPLUS_ROOT $ENV{LOG4CPLUS_ROOT})
endif()
-# Additionally try and use pkconfig to find log4cplus
-
-if(NOT DEFINED PKG_CONFIG_FOUND)
- find_package(PkgConfig)
-endif()
-pkg_check_modules(PC_Log4cplus QUIET log4cplus)
-
# ------------------------------------------------------------------------
# Search for Log4cplus include DIR
# ------------------------------------------------------------------------
diff --git a/cmake/FindOpenEXR.cmake b/cmake/FindOpenEXR.cmake
index d0d356f..3d243d0 100644
--- a/cmake/FindOpenEXR.cmake
+++ b/cmake/FindOpenEXR.cmake
@@ -135,13 +135,6 @@ elseif(DEFINED ENV{OPENEXR_ROOT})
set(_OPENEXR_ROOT $ENV{OPENEXR_ROOT})
endif()
-# Additionally try and use pkconfig to find OpenEXR
-
-if(NOT DEFINED PKG_CONFIG_FOUND)
- find_package(PkgConfig)
-endif()
-pkg_check_modules(PC_OpenEXR QUIET OpenEXR)
-
# ------------------------------------------------------------------------
# Search for OpenEXR include DIR
# ------------------------------------------------------------------------
diff --git a/cmake/FindOpenVDB.cmake b/cmake/FindOpenVDB.cmake
index 18b1c83..01a2f04 100644
--- a/cmake/FindOpenVDB.cmake
+++ b/cmake/FindOpenVDB.cmake
@@ -142,13 +142,6 @@ elseif(DEFINED ENV{OPENVDB_ROOT})
set(_OPENVDB_ROOT $ENV{OPENVDB_ROOT})
endif()
-# Additionally try and use pkconfig to find OpenVDB
-
-if(NOT DEFINED PKG_CONFIG_FOUND)
- find_package(PkgConfig)
-endif()
-pkg_check_modules(PC_OpenVDB QUIET OpenVDB)
-
# This CMake module supports being called from external packages AND from
# within the OpenVDB repository for building openvdb components with the
# core library build disabled. Determine where we are being called from:
diff --git a/cmake/FindTBB.cmake b/cmake/FindTBB.cmake
index a537300..4be895b 100644
--- a/cmake/FindTBB.cmake
+++ b/cmake/FindTBB.cmake
@@ -126,13 +126,6 @@ elseif(DEFINED ENV{TBB_ROOT})
set(_TBB_ROOT $ENV{TBB_ROOT})
endif()
-# Additionally try and use pkconfig to find Tbb
-
-if(NOT DEFINED PKG_CONFIG_FOUND)
- find_package(PkgConfig)
-endif()
-pkg_check_modules(PC_Tbb QUIET tbb)
-
# ------------------------------------------------------------------------
# Search for tbb include DIR
# ------------------------------------------------------------------------
diff --git a/cmake/OpenVDBGLFW3Setup.cmake b/cmake/OpenVDBGLFW3Setup.cmake
index 84e54d9..bac685c 100644
--- a/cmake/OpenVDBGLFW3Setup.cmake
+++ b/cmake/OpenVDBGLFW3Setup.cmake
@@ -65,14 +65,6 @@ else()
endif()
endif()
-# Additionally try and use pkconfig to find glfw, though we only use
-# pkg-config to re-direct to the cmake. In other words, glfw's cmake is
-# expected to be installed
-if(NOT DEFINED PKG_CONFIG_FOUND)
- find_package(PkgConfig)
-endif()
-pkg_check_modules(PC_glfw3 QUIET glfw3)
-
if(PC_glfw3_FOUND)
foreach(DIR ${PC_glfw3_LIBRARY_DIRS})
list(APPEND _GLFW3_ROOT_SEARCH_DIR ${DIR})

View File

@ -1,308 +0,0 @@
diff --git a/cmake/FindBlosc.cmake b/cmake/FindBlosc.cmake
index 3ead1b3..0522e4a 100644
--- a/cmake/FindBlosc.cmake
+++ b/cmake/FindBlosc.cmake
@@ -75,6 +75,7 @@ if(POLICY CMP0074)
cmake_policy(SET CMP0074 NEW)
endif()
+if(0)
mark_as_advanced(
Blosc_INCLUDE_DIR
Blosc_LIBRARY
@@ -206,3 +207,30 @@ if(Blosc_FOUND)
elseif(Blosc_FIND_REQUIRED)
message(FATAL_ERROR "Unable to find Blosc")
endif()
+else()
+FIND_PACKAGE ( PackageHandleStandardArgs )
+FIND_PATH( BLOSC_LOCATION include/blosc.h)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS ( Blosc
+ REQUIRED_VARS BLOSC_LOCATION
+ )
+IF ( BLOSC_FOUND )
+SET ( _blosc_library_name "blosc" )
+ # Static library setup
+ IF (Blosc_USE_STATIC_LIBS)
+ SET(CMAKE_FIND_LIBRARY_SUFFIXES_BACKUP ${CMAKE_FIND_LIBRARY_SUFFIXES})
+ IF (WIN32)
+ SET ( _blosc_library_name "libblosc" )
+ ELSE ()
+ SET(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
+ ENDIF ()
+ ENDIF()
+ FIND_LIBRARY ( BLOSC_blosc_LIBRARY ${_blosc_library_name}
+ NO_SYSTEM_ENVIRONMENT_PATH
+ )
+ # Static library tear down
+ IF (Blosc_USE_STATIC_LIBS)
+ SET( CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_BACKUP} )
+ ENDIF()
+ SET( BLOSC_INCLUDE_DIR "${BLOSC_LOCATION}/include" CACHE STRING "Blosc include directory" )
+ENDIF ( BLOSC_FOUND )
+endif()
\ No newline at end of file
diff --git a/cmake/FindIlmBase.cmake b/cmake/FindIlmBase.cmake
index 00a6d30..10322fd 100644
--- a/cmake/FindIlmBase.cmake
+++ b/cmake/FindIlmBase.cmake
@@ -84,6 +84,7 @@ may be provided to tell this module where to look.
cmake_minimum_required(VERSION 3.3)
+if(0)
# Monitoring <PackageName>_ROOT variables
if(POLICY CMP0074)
cmake_policy(SET CMP0074 NEW)
@@ -320,3 +321,144 @@ if(IlmBase_FOUND)
elseif(IlmBase_FIND_REQUIRED)
message(FATAL_ERROR "Unable to find IlmBase")
endif()
+else()
+FIND_PACKAGE ( PackageHandleStandardArgs )
+FIND_PATH ( ILMBASE_LOCATION include/OpenEXR/IlmBaseConfig.h)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS ( ILMBase
+ REQUIRED_VARS ILMBASE_LOCATION
+ )
+OPTION ( ILMBASE_NAMESPACE_VERSIONING "Namespace versioning of libraries" ON )
+
+IF ( ILMBASE_FOUND )
+
+ FILE ( STRINGS "${ILMBASE_LOCATION}/include/OpenEXR/IlmBaseConfig.h" _ilmbase_version_major_string REGEX "#define ILMBASE_VERSION_MAJOR ")
+ STRING ( REGEX REPLACE "#define ILMBASE_VERSION_MAJOR" "" _ilmbase_version_major_unstrip "${_ilmbase_version_major_string}")
+ STRING ( STRIP "${_ilmbase_version_major_unstrip}" ILMBASE_VERSION_MAJOR )
+
+ FILE ( STRINGS "${ILMBASE_LOCATION}/include/OpenEXR/IlmBaseConfig.h" _ilmbase_version_minor_string REGEX "#define ILMBASE_VERSION_MINOR ")
+ STRING ( REGEX REPLACE "#define ILMBASE_VERSION_MINOR" "" _ilmbase_version_minor_unstrip "${_ilmbase_version_minor_string}")
+ STRING ( STRIP "${_ilmbase_version_minor_unstrip}" ILMBASE_VERSION_MINOR )
+
+ IF ( ILMBASE_NAMESPACE_VERSIONING )
+ SET ( IEX_LIBRARY_NAME Iex-${ILMBASE_VERSION_MAJOR}_${ILMBASE_VERSION_MINOR} )
+ SET ( IEXMATH_LIBRARY_NAME IexMath-${ILMBASE_VERSION_MAJOR}_${ILMBASE_VERSION_MINOR} )
+ SET ( ILMTHREAD_LIBRARY_NAME IlmThread-${ILMBASE_VERSION_MAJOR}_${ILMBASE_VERSION_MINOR} )
+ SET ( IMATH_LIBRARY_NAME Imath-${ILMBASE_VERSION_MAJOR}_${ILMBASE_VERSION_MINOR} )
+ SET ( HALF_LIBRARY_NAME Half-${ILMBASE_VERSION_MAJOR}_${ILMBASE_VERSION_MINOR} )
+ ELSE ( ILMBASE_NAMESPACE_VERSIONING )
+ SET ( IEX_LIBRARY_NAME Iex )
+ SET ( IEXMATH_LIBRARY_NAME IexMath )
+ SET ( ILMTHREAD_LIBRARY_NAME IlmThread )
+ SET ( IMATH_LIBRARY_NAME Imath )
+ SET ( HALF_LIBRARY_NAME Half )
+ ENDIF ( ILMBASE_NAMESPACE_VERSIONING )
+
+ SET ( ILMBASE_INCLUDE_DIRS
+ ${ILMBASE_LOCATION}/include
+ ${ILMBASE_LOCATION}/include/OpenEXR
+ CACHE STRING "ILMBase include directories")
+ SET ( ILMBASE_LIBRARYDIR ${ILMBASE_LOCATION}/lib
+ CACHE STRING "ILMBase library directories")
+ SET ( ILMBASE_FOUND TRUE )
+
+ SET ( ORIGINAL_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
+ IF (Ilmbase_USE_STATIC_LIBS)
+ IF (APPLE)
+ SET(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
+ FIND_LIBRARY ( Ilmbase_HALF_LIBRARY Half PATHS ${ILMBASE_LIBRARYDIR} )
+ FIND_LIBRARY ( Ilmbase_IEX_LIBRARY Iex PATHS ${ILMBASE_LIBRARYDIR} )
+ FIND_LIBRARY ( Ilmbase_ILMTHREAD_LIBRARY IlmThread PATHS ${ILMBASE_LIBRARYDIR} )
+ FIND_LIBRARY ( Ilmbase_IMATH_LIBRARY Imath PATHS ${ILMBASE_LIBRARYDIR} )
+ ELSEIF (WIN32)
+ # Link library
+ SET(CMAKE_FIND_LIBRARY_SUFFIXES ".lib")
+ FIND_LIBRARY ( Ilmbase_HALF_LIBRARY Half_static PATHS ${ILMBASE_LIBRARYDIR} )
+ FIND_LIBRARY ( Ilmbase_IEX_LIBRARY Iex_static PATHS ${ILMBASE_LIBRARYDIR} )
+ FIND_LIBRARY ( Ilmbase_ILMTHREAD_LIBRARY IlmThread_static PATHS ${ILMBASE_LIBRARYDIR} )
+ FIND_LIBRARY ( Ilmbase_IMATH_LIBRARY Imath_static PATHS ${ILMBASE_LIBRARYDIR} )
+ ELSE (APPLE)
+ SET ( CMAKE_FIND_LIBRARY_SUFFIXES ".a")
+ FIND_LIBRARY ( Ilmbase_HALF_LIBRARY Half PATHS ${ILMBASE_LIBRARYDIR}
+ NO_DEFAULT_PATH
+ NO_SYSTEM_ENVIRONMENT_PATH
+ )
+ FIND_LIBRARY ( Ilmbase_IEX_LIBRARY Iex PATHS ${ILMBASE_LIBRARYDIR}
+ NO_DEFAULT_PATH
+ NO_SYSTEM_ENVIRONMENT_PATH
+ )
+ FIND_LIBRARY ( Ilmbase_ILMTHREAD_LIBRARY IlmThread PATHS ${ILMBASE_LIBRARYDIR}
+ NO_DEFAULT_PATH
+ NO_SYSTEM_ENVIRONMENT_PATH
+ )
+ FIND_LIBRARY ( Ilmbase_IMATH_LIBRARY Imath PATHS ${ILMBASE_LIBRARYDIR}
+ NO_DEFAULT_PATH
+ NO_SYSTEM_ENVIRONMENT_PATH
+ )
+ ENDIF (APPLE)
+ ELSE (Ilmbase_USE_STATIC_LIBS)
+ IF (APPLE)
+ SET(CMAKE_FIND_LIBRARY_SUFFIXES ".dylib")
+ FIND_LIBRARY ( Ilmbase_HALF_LIBRARY Half PATHS ${ILMBASE_LIBRARYDIR} )
+ FIND_LIBRARY ( Ilmbase_IEX_LIBRARY Iex PATHS ${ILMBASE_LIBRARYDIR} )
+ FIND_LIBRARY ( Ilmbase_ILMTHREAD_LIBRARY IlmThread PATHS ${ILMBASE_LIBRARYDIR} )
+ FIND_LIBRARY ( Ilmbase_IMATH_LIBRARY Imath PATHS ${ILMBASE_LIBRARYDIR} )
+ ELSEIF (WIN32)
+ # Link library
+ SET(CMAKE_FIND_LIBRARY_SUFFIXES ".lib")
+ FIND_LIBRARY ( Ilmbase_HALF_LIBRARY ${HALF_LIBRARY_NAME} PATHS ${ILMBASE_LIBRARYDIR} )
+ FIND_LIBRARY ( Ilmbase_IEX_LIBRARY ${IEX_LIBRARY_NAME} PATHS ${ILMBASE_LIBRARYDIR} )
+ FIND_LIBRARY ( Ilmbase_IEXMATH_LIBRARY ${IEXMATH_LIBRARY_NAME} PATHS ${ILMBASE_LIBRARYDIR} )
+ FIND_LIBRARY ( Ilmbase_ILMTHREAD_LIBRARY ${ILMTHREAD_LIBRARY_NAME} PATHS ${ILMBASE_LIBRARYDIR} )
+ FIND_LIBRARY ( Ilmbase_IMATH_LIBRARY ${IMATH_LIBRARY_NAME} PATHS ${ILMBASE_LIBRARYDIR} )
+ # Load library
+ SET(CMAKE_FIND_LIBRARY_SUFFIXES ".dll")
+ FIND_LIBRARY ( Ilmbase_HALF_DLL ${HALF_LIBRARY_NAME} PATHS ${ILMBASE_LOCATION}/bin
+ NO_DEFAULT_PATH
+ NO_SYSTEM_ENVIRONMENT_PATH
+ )
+ FIND_LIBRARY ( Ilmbase_IEX_DLL ${IEX_LIBRARY_NAME} PATHS ${ILMBASE_LIBRARYDIR}
+ NO_DEFAULT_PATH
+ NO_SYSTEM_ENVIRONMENT_PATH
+ )
+ FIND_LIBRARY ( Ilmbase_IEXMATH_DLL ${IEXMATH_LIBRARY_NAME} PATHS ${ILMBASE_LIBRARYDIR}
+ NO_DEFAULT_PATH
+ NO_SYSTEM_ENVIRONMENT_PATH
+ )
+ FIND_LIBRARY ( Ilmbase_ILMTHREAD_DLL ${ILMTHREAD_LIBRARY_NAME} PATHS ${ILMBASE_LIBRARYDIR}
+ NO_DEFAULT_PATH
+ NO_SYSTEM_ENVIRONMENT_PATH
+ )
+ FIND_LIBRARY ( Ilmbase_IMATH_DLL ${IMATH_LIBRARY_NAME} PATHS ${ILMBASE_LIBRARYDIR}
+ NO_DEFAULT_PATH
+ NO_SYSTEM_ENVIRONMENT_PATH
+ )
+ ELSE (APPLE)
+ FIND_LIBRARY ( Ilmbase_HALF_LIBRARY ${HALF_LIBRARY_NAME} PATHS ${ILMBASE_LIBRARYDIR}
+ NO_DEFAULT_PATH
+ NO_SYSTEM_ENVIRONMENT_PATH
+ )
+ FIND_LIBRARY ( Ilmbase_IEX_LIBRARY ${IEX_LIBRARY_NAME} PATHS ${ILMBASE_LIBRARYDIR}
+ NO_DEFAULT_PATH
+ NO_SYSTEM_ENVIRONMENT_PATH
+ )
+ FIND_LIBRARY ( Ilmbase_IEXMATH_LIBRARY ${IEXMATH_LIBRARY_NAME} PATHS ${ILMBASE_LIBRARYDIR}
+ NO_DEFAULT_PATH
+ NO_SYSTEM_ENVIRONMENT_PATH
+ )
+ FIND_LIBRARY ( Ilmbase_ILMTHREAD_LIBRARY ${ILMTHREAD_LIBRARY_NAME} PATHS ${ILMBASE_LIBRARYDIR}
+ NO_DEFAULT_PATH
+ NO_SYSTEM_ENVIRONMENT_PATH
+ )
+ FIND_LIBRARY ( Ilmbase_IMATH_LIBRARY ${IMATH_LIBRARY_NAME} PATHS ${ILMBASE_LIBRARYDIR}
+ NO_DEFAULT_PATH
+ NO_SYSTEM_ENVIRONMENT_PATH
+ )
+ ENDIF (APPLE)
+ ENDIF ()
+ # MUST reset
+ SET(CMAKE_FIND_LIBRARY_SUFFIXES ${ORIGINAL_CMAKE_FIND_LIBRARY_SUFFIXES})
+
+ELSE ( ILMBASE_FOUND )
+ MESSAGE ( FATAL_ERROR "Unable to find ILMBase, ILMBASE_ROOT = $ENV{ILMBASE_ROOT}")
+ENDIF ( ILMBASE_FOUND )
+endif()
\ No newline at end of file
diff --git a/cmake/FindOpenEXR.cmake b/cmake/FindOpenEXR.cmake
index 3d243d0..a3340da 100644
--- a/cmake/FindOpenEXR.cmake
+++ b/cmake/FindOpenEXR.cmake
@@ -80,6 +80,7 @@ may be provided to tell this module where to look.
cmake_minimum_required(VERSION 3.3)
+if(0)
# Monitoring <PackageName>_ROOT variables
if(POLICY CMP0074)
cmake_policy(SET CMP0074 NEW)
@@ -312,3 +313,92 @@ if(OpenEXR_FOUND)
elseif(OpenEXR_FIND_REQUIRED)
message(FATAL_ERROR "Unable to find OpenEXR")
endif()
+else()
+include(FindPackageHandleStandardArgs)
+
+find_path(OpenEXR_INCLUDE_DIRS OpenEXR/OpenEXRConfig.h)
+find_path(OPENEXR_INCLUDE_PATHS NAMES ImfRgbaFile.h PATH_SUFFIXES OpenEXR)
+
+file(STRINGS "${OpenEXR_INCLUDE_DIRS}/OpenEXR/OpenEXRConfig.h" OPENEXR_CONFIG_H)
+
+string(REGEX REPLACE "^.*define OPENEXR_VERSION_MAJOR ([0-9]+).*$" "\\1" OpenEXR_VERSION_MAJOR "${OPENEXR_CONFIG_H}")
+string(REGEX REPLACE "^.*define OPENEXR_VERSION_MINOR ([0-9]+).*$" "\\1" OpenEXR_VERSION_MINOR "${OPENEXR_CONFIG_H}")
+set(OpenEXR_LIB_SUFFIX "${OpenEXR_VERSION_MAJOR}_${OpenEXR_VERSION_MINOR}")
+
+include(SelectLibraryConfigurations)
+
+if(NOT OpenEXR_BASE_LIBRARY)
+ find_library(OpenEXR_BASE_LIBRARY_RELEASE NAMES IlmImf-${OpenEXR_LIB_SUFFIX})
+ find_library(OpenEXR_BASE_LIBRARY_DEBUG NAMES IlmImf-${OpenEXR_LIB_SUFFIX}_d)
+ select_library_configurations(OpenEXR_BASE)
+endif()
+
+if(NOT OpenEXR_UTIL_LIBRARY)
+ find_library(OpenEXR_UTIL_LIBRARY_RELEASE NAMES IlmImfUtil-${OpenEXR_LIB_SUFFIX})
+ find_library(OpenEXR_UTIL_LIBRARY_DEBUG NAMES IlmImfUtil-${OpenEXR_LIB_SUFFIX}_d)
+ select_library_configurations(OpenEXR_UTIL)
+endif()
+
+if(NOT OpenEXR_HALF_LIBRARY)
+ find_library(OpenEXR_HALF_LIBRARY_RELEASE NAMES Half-${OpenEXR_LIB_SUFFIX})
+ find_library(OpenEXR_HALF_LIBRARY_DEBUG NAMES Half-${OpenEXR_LIB_SUFFIX}_d)
+ select_library_configurations(OpenEXR_HALF)
+endif()
+
+if(NOT OpenEXR_IEX_LIBRARY)
+ find_library(OpenEXR_IEX_LIBRARY_RELEASE NAMES Iex-${OpenEXR_LIB_SUFFIX})
+ find_library(OpenEXR_IEX_LIBRARY_DEBUG NAMES Iex-${OpenEXR_LIB_SUFFIX}_d)
+ select_library_configurations(OpenEXR_IEX)
+endif()
+
+if(NOT OpenEXR_MATH_LIBRARY)
+ find_library(OpenEXR_MATH_LIBRARY_RELEASE NAMES Imath-${OpenEXR_LIB_SUFFIX})
+ find_library(OpenEXR_MATH_LIBRARY_DEBUG NAMES Imath-${OpenEXR_LIB_SUFFIX}_d)
+ select_library_configurations(OpenEXR_MATH)
+endif()
+
+if(NOT OpenEXR_THREAD_LIBRARY)
+ find_library(OpenEXR_THREAD_LIBRARY_RELEASE NAMES IlmThread-${OpenEXR_LIB_SUFFIX})
+ find_library(OpenEXR_THREAD_LIBRARY_DEBUG NAMES IlmThread-${OpenEXR_LIB_SUFFIX}_d)
+ select_library_configurations(OpenEXR_THREAD)
+endif()
+
+if(NOT OpenEXR_IEXMATH_LIBRARY)
+ find_library(OpenEXR_IEXMATH_LIBRARY_RELEASE NAMES IexMath-${OpenEXR_LIB_SUFFIX})
+ find_library(OpenEXR_IEXMATH_LIBRARY_DEBUG NAMES IexMath-${OpenEXR_LIB_SUFFIX}d)
+ select_library_configurations(OpenEXR_IEXMATH)
+endif()
+
+set(OPENEXR_HALF_LIBRARY "${OpenEXR_HALF_LIBRARY}")
+set(OPENEXR_IEX_LIBRARY "${OpenEXR_IEX_LIBRARY}")
+set(OPENEXR_IMATH_LIBRARY "${OpenEXR_MATH_LIBRARY}")
+set(OPENEXR_ILMIMF_LIBRARY "${OpenEXR_BASE_LIBRARY}")
+set(OPENEXR_ILMIMFUTIL_LIBRARY "${OpenEXR_UTIL_LIBRARY}")
+set(OPENEXR_ILMTHREAD_LIBRARY "${OpenEXR_THREAD_LIBRARY}")
+
+set(OpenEXR_LIBRARY "${OpenEXR_BASE_LIBRARY}")
+
+set(OpenEXR_LIBRARIES
+ ${OpenEXR_LIBRARY}
+ ${OpenEXR_MATH_LIBRARY}
+ ${OpenEXR_IEXMATH_LIBRARY}
+ ${OpenEXR_UTIL_LIBRARY}
+ ${OpenEXR_HALF_LIBRARY}
+ ${OpenEXR_IEX_LIBRARY}
+ ${OpenEXR_THREAD_LIBRARY}
+)
+
+set(OPENEXR_LIBRARIES
+ ${OPENEXR_HALF_LIBRARY}
+ ${OPENEXR_IEX_LIBRARY}
+ ${OPENEXR_IMATH_LIBRARY}
+ ${OPENEXR_ILMIMF_LIBRARY}
+ ${OPENEXR_ILMTHREAD_LIBRARY}
+)
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenEXR REQUIRED_VARS OpenEXR_LIBRARIES OpenEXR_INCLUDE_DIRS)
+
+if(OpenEXR_FOUND)
+ set(OPENEXR_FOUND 1)
+endif()
+endif()
\ No newline at end of file

View File

@ -1,133 +1,76 @@
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}
)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f2e8c2a..4fd3f40 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -360,7 +360,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 b065192..286e8b6 100644
--- a/cmake/FindOpenVDB.cmake
+++ b/cmake/FindOpenVDB.cmake
@@ -430,7 +430,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 AND NOT Boost_USE_STATIC_LIBS)
diff --git a/openvdb/CMakeLists.txt b/openvdb/CMakeLists.txt
index 45b302c..e208bcf 100644
--- a/openvdb/CMakeLists.txt
+++ b/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 REQUIRED)
+ find_package(OpenEXR REQUIRED)
else()
- find_package(IlmBase ${MINIMUM_ILMBASE_VERSION} REQUIRED COMPONENTS Half)
+ find_package(IlmBase REQUIRED COMPONENTS Half)
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)
diff --git a/openvdb/cmd/CMakeLists.txt b/openvdb/cmd/CMakeLists.txt
index 2b831bb..2fa11d4 100644
--- a/openvdb/cmd/CMakeLists.txt
+++ b/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()

View File

@ -1,5 +1,5 @@
Source: openvdb
Version: 7.0.0
Version: 7.1.0
Build-Depends: boost-ptr-container, openexr, tbb, blosc, boost-iostreams, boost-system, boost-thread, boost-date-time, boost-any, boost-uuid, boost-interprocess, ilmbase
Homepage: https://github.com/dreamworksanimation/openvdb
Description: Sparse volume data structure and tools

View File

@ -1,25 +1,19 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO AcademySoftwareFoundation/openvdb
REF c5e9e2944f085907e973b627843c49c838afe912 # v7.0.0
SHA512 351611b04a192bcc501da599e55892a5dc7570dce6c0aea287d800612a20f6cb2a0d7825e062aa99f12bc2a968c51c7fe6af61badfdbd746edbd4e9fc9e4f2a4
REF 2a7966ccb184092a49355c04bccb014d84956ff7 # v7.1.0
SHA512 6d3d2481fd116c5fd8fdf84a5139cd6e6986e188c3a5def05ec3bee47bd31bee3099a1d317a330b10c2cf93094f305eeeea02cadcabfc81f8ffc60bf8acdb84e
HEAD_REF master
PATCHES
0001-remove-pkgconfig.patch
0002-fix-cmake-modules.patch
0003-fix-cmake.patch
)
file(REMOVE ${SOURCE_PATH}/cmake/FindTBB.cmake)
if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
set(OPENVDB_STATIC ON)
set(OPENVDB_SHARED OFF)
else()
set(OPENVDB_STATIC OFF)
set(OPENVDB_SHARED ON)
endif()
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" OPENVDB_STATIC)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" OPENVDB_SHARED)
set(OPENVDB_BUILD_TOOLS OFF)
if ("tools" IN_LIST FEATURES)
if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
set(OPENVDB_BUILD_TOOLS ON)
@ -40,8 +34,9 @@ vcpkg_configure_cmake(
-DOPENVDB_CORE_SHARED=${OPENVDB_SHARED}
-DOPENVDB_BUILD_VDB_PRINT=${OPENVDB_BUILD_TOOLS}
-DOPENVDB_BUILD_VDB_VIEW=${OPENVDB_BUILD_TOOLS}
#-DOPENVDB_BUILD_VDB_RENDER=${OPENVDB_BUILD_TOOLS} # Enable vdb_render when https://github.com/openexr/openexr/issues/302 is fixed
-DOPENVDB_BUILD_VDB_RENDER=${OPENVDB_BUILD_TOOLS}
-DOPENVDB_BUILD_VDB_LOD=${OPENVDB_BUILD_TOOLS}
-DUSE_PKGCONFIG=OFF
)
vcpkg_install_cmake()
@ -53,20 +48,8 @@ vcpkg_copy_pdbs()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share)
if (OPENVDB_BUILD_TOOLS)
# copy tools to tools/openvdb directory
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/${PORT}/)
file(RENAME ${CURRENT_PACKAGES_DIR}/bin/vdb_print.exe ${CURRENT_PACKAGES_DIR}/tools/${PORT}/vdb_print.exe)
#file(RENAME ${CURRENT_PACKAGES_DIR}/bin/vdb_render.exe ${CURRENT_PACKAGES_DIR}/tools/${PORT}/vdb_render.exe)
#file(RENAME ${CURRENT_PACKAGES_DIR}/bin/vdb_view.exe ${CURRENT_PACKAGES_DIR}/tools/${PORT}/vdb_view.exe) # vdb_view does not support win32 currently.
file(RENAME ${CURRENT_PACKAGES_DIR}/bin/vdb_lod.exe ${CURRENT_PACKAGES_DIR}/tools/${PORT}/vdb_lod.exe)
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT})
# remove debug versions of tools
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/vdb_print.exe)
#file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/vdb_render.exe)
#file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/vdb_view.exe) # vdb_view does not support win32 currently.
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/vdb_lod.exe)
vcpkg_copy_tools(TOOL_NAMES vdb_print vdb_render vdb_view vdb_lod AUTO_CLEAN)
endif()
# Handle copyright
file(INSTALL ${SOURCE_PATH}/openvdb/COPYRIGHT DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
file(INSTALL ${SOURCE_PATH}/openvdb/COPYRIGHT DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)