[openvdb]Upgrade version to 6.1.0, regenerate patches and fix build errors. (#6864)

This commit is contained in:
JackBoosY 2019-06-27 01:33:36 +08:00 committed by Phil Christensen
parent 9c3e312d81
commit eff0769b75
10 changed files with 1366 additions and 603 deletions

View File

@ -1,207 +0,0 @@
diff --git a/cmake/FindBlosc.cmake b/cmake/FindBlosc.cmake
index 2d9d9d3..e9b4abc 100644
--- a/cmake/FindBlosc.cmake
+++ b/cmake/FindBlosc.cmake
@@ -37,11 +37,7 @@
FIND_PACKAGE ( PackageHandleStandardArgs )
-FIND_PATH( BLOSC_LOCATION include/blosc.h
- "$ENV{BLOSC_ROOT}"
- NO_DEFAULT_PATH
- NO_SYSTEM_ENVIRONMENT_PATH
- )
+FIND_PATH( BLOSC_LOCATION include/blosc.h)
FIND_PACKAGE_HANDLE_STANDARD_ARGS ( Blosc
REQUIRED_VARS BLOSC_LOCATION
@@ -53,7 +49,7 @@ IF ( BLOSC_FOUND )
CACHE STRING "Blosc library directories")
SET ( _blosc_library_name "blosc" )
-
+
# Static library setup
IF (Blosc_USE_STATIC_LIBS)
SET(CMAKE_FIND_LIBRARY_SUFFIXES_BACKUP ${CMAKE_FIND_LIBRARY_SUFFIXES})
@@ -69,7 +65,7 @@ IF ( BLOSC_FOUND )
NO_DEFAULT_PATH
NO_SYSTEM_ENVIRONMENT_PATH
)
-
+
# Static library tear down
IF (Blosc_USE_STATIC_LIBS)
SET( CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_BACKUP} )
diff --git a/cmake/FindGLEW.cmake b/cmake/FindGLEW.cmake
index 0b72457..75951a6 100644
--- a/cmake/FindGLEW.cmake
+++ b/cmake/FindGLEW.cmake
@@ -39,11 +39,7 @@
FIND_PACKAGE ( PackageHandleStandardArgs )
-FIND_PATH( GLEW_LOCATION include/GL/glew.h
- "$ENV{GLEW_ROOT}"
- NO_DEFAULT_PATH
- NO_SYSTEM_ENVIRONMENT_PATH
- )
+FIND_PATH( GLEW_LOCATION include/GL/glew.h)
FIND_PACKAGE_HANDLE_STANDARD_ARGS ( GLEW
REQUIRED_VARS GLEW_LOCATION
diff --git a/cmake/FindGLFW3.cmake b/cmake/FindGLFW3.cmake
index cea0b86..07ea09e 100644
--- a/cmake/FindGLFW3.cmake
+++ b/cmake/FindGLFW3.cmake
@@ -39,11 +39,7 @@
FIND_PACKAGE ( PackageHandleStandardArgs )
-FIND_PATH( GLFW3_LOCATION include/GLFW/glfw3.h
- "$ENV{GLFW3_ROOT}"
- NO_DEFAULT_PATH
- NO_SYSTEM_ENVIRONMENT_PATH
-)
+FIND_PATH( GLFW3_LOCATION include/GLFW/glfw3.h)
FIND_PACKAGE_HANDLE_STANDARD_ARGS ( GLFW3
REQUIRED_VARS GLFW3_LOCATION
@@ -59,7 +59,7 @@ IF (GLFW3_FOUND)
NO_CMAKE_SYSTEM_PATH
)
ELSE (GLFW3_USE_STATIC_LIBS)
- FIND_LIBRARY ( GLFW3_glfw_LIBRARY glfw
+ FIND_LIBRARY ( GLFW3_glfw_LIBRARY glfw3dll
PATHS ${GLFW3_LOCATION}/lib
PATH_SUFFIXES ${GLFW3_PATH_SUFFIXES}
NO_DEFAULT_PATH
diff --git a/cmake/FindILMBase.cmake b/cmake/FindILMBase.cmake
index 664affd..5197110 100644
--- a/cmake/FindILMBase.cmake
+++ b/cmake/FindILMBase.cmake
@@ -43,11 +43,7 @@
FIND_PACKAGE ( PackageHandleStandardArgs )
-FIND_PATH ( ILMBASE_LOCATION include/OpenEXR/IlmBaseConfig.h
- "$ENV{ILMBASE_ROOT}"
- NO_DEFAULT_PATH
- NO_SYSTEM_ENVIRONMENT_PATH
- )
+FIND_PATH ( ILMBASE_LOCATION include/OpenEXR/IlmBaseConfig.h)
FIND_PACKAGE_HANDLE_STANDARD_ARGS ( ILMBase
REQUIRED_VARS ILMBASE_LOCATION
@@ -70,11 +66,13 @@ IF ( ILMBASE_FOUND )
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
@@ -84,7 +82,7 @@ IF ( ILMBASE_FOUND )
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)
@@ -129,14 +127,14 @@ IF ( ILMBASE_FOUND )
ELSEIF (WIN32)
# Link library
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".lib")
- FIND_LIBRARY ( Ilmbase_HALF_LIBRARY Half PATHS ${ILMBASE_LIBRARYDIR} )
+ 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 PATHS ${ILMBASE_LOCATION}/bin
+ FIND_LIBRARY ( Ilmbase_HALF_DLL ${HALF_LIBRARY_NAME} PATHS ${ILMBASE_LOCATION}/bin
NO_DEFAULT_PATH
NO_SYSTEM_ENVIRONMENT_PATH
)
@@ -157,7 +155,7 @@ IF ( ILMBASE_FOUND )
NO_SYSTEM_ENVIRONMENT_PATH
)
ELSE (APPLE)
- FIND_LIBRARY ( Ilmbase_HALF_LIBRARY Half PATHS ${ILMBASE_LIBRARYDIR}
+ FIND_LIBRARY ( Ilmbase_HALF_LIBRARY ${HALF_LIBRARY_NAME} PATHS ${ILMBASE_LIBRARYDIR}
NO_DEFAULT_PATH
NO_SYSTEM_ENVIRONMENT_PATH
)
diff --git a/cmake/FindOpenEXR.cmake b/cmake/FindOpenEXR.cmake
index 6d69c03..5ecf8fa 100644
--- a/cmake/FindOpenEXR.cmake
+++ b/cmake/FindOpenEXR.cmake
@@ -38,11 +38,7 @@
FIND_PACKAGE ( PackageHandleStandardArgs )
-FIND_PATH ( OPENEXR_LOCATION include/OpenEXR/OpenEXRConfig.h
- ENV OPENEXR_ROOT
- NO_DEFAULT_PATH
- NO_SYSTEM_ENVIRONMENT_PATH
- )
+FIND_PATH ( OPENEXR_LOCATION include/OpenEXR/OpenEXRConfig.h)
FIND_PACKAGE_HANDLE_STANDARD_ARGS ( OpenEXR
REQUIRED_VARS OPENEXR_LOCATION
@@ -59,7 +55,7 @@ IF ( OPENEXR_FOUND )
FILE ( STRINGS "${OPENEXR_LOCATION}/include/OpenEXR/OpenEXRConfig.h" _openexr_version_minor_string REGEX "#define OPENEXR_VERSION_MINOR ")
STRING ( REGEX REPLACE "#define OPENEXR_VERSION_MINOR" "" _openexr_version_minor_unstrip "${_openexr_version_minor_string}")
STRING ( STRIP "${_openexr_version_minor_unstrip}" OPENEXR_VERSION_MINOR )
-
+
MESSAGE ( STATUS "Found OpenEXR v${OPENEXR_VERSION_MAJOR}.${OPENEXR_VERSION_MINOR} at ${OPENEXR_LOCATION}" )
IF ( OPENEXR_NAMESPACE_VERSIONING )
@@ -67,7 +63,7 @@ IF ( OPENEXR_FOUND )
ELSE ( OPENEXR_NAMESPACE_VERSIONING )
SET ( ILMIMF_LIBRARY_NAME IlmImf )
ENDIF ( OPENEXR_NAMESPACE_VERSIONING )
-
+
SET ( OPENEXR_INCLUDE_DIRS
${OPENEXR_LOCATION}/include
${OPENEXR_LOCATION}/include/OpenEXR
@@ -120,6 +116,5 @@ IF ( OPENEXR_FOUND )
ENDIF ()
# SET( Openexr_ILMIMF_LIBRARY ${OPENEXR_ILMIMF_LIBRARY_PATH} CACHE STRING "Openexr's IlmImf library")
-
-ENDIF ( OPENEXR_FOUND )
+ENDIF ( OPENEXR_FOUND )
diff --git a/cmake/FindTBB.cmake b/cmake/FindTBB.cmake
index 8a56ec0..9f5a7b4 100644
--- a/cmake/FindTBB.cmake
+++ b/cmake/FindTBB.cmake
@@ -42,14 +42,7 @@ FIND_PACKAGE ( PackageHandleStandardArgs )
# SET ( TBB_FOUND FALSE )
-FIND_PATH( TBB_LOCATION include/tbb/tbb.h
- "$ENV{TBB_ROOT}"
- NO_DEFAULT_PATH
- NO_CMAKE_ENVIRONMENT_PATH
- NO_CMAKE_PATH
- NO_SYSTEM_ENVIRONMENT_PATH
- NO_CMAKE_SYSTEM_PATH
- )
+FIND_PATH( TBB_LOCATION include/tbb/tbb.h)
FIND_PACKAGE_HANDLE_STANDARD_ARGS ( TBB
REQUIRED_VARS TBB_LOCATION

View File

@ -0,0 +1,129 @@
diff --git a/cmake/FindBlosc.cmake b/cmake/FindBlosc.cmake
index 03e361e..b44f46d 100644
--- a/cmake/FindBlosc.cmake
+++ b/cmake/FindBlosc.cmake
@@ -104,11 +104,6 @@ else()
endif()
endif()
-# Additionally try and use pkconfig to find blosc
-
-find_package(PkgConfig)
-pkg_check_modules(PC_Blosc QUIET blosc)
-
# ------------------------------------------------------------------------
# Search for blosc include DIR
# ------------------------------------------------------------------------
diff --git a/cmake/FindCppUnit.cmake b/cmake/FindCppUnit.cmake
index fb8a28b..fea685e 100644
--- a/cmake/FindCppUnit.cmake
+++ b/cmake/FindCppUnit.cmake
@@ -106,11 +106,6 @@ else()
endif()
endif()
-# Additionally try and use pkconfig to find cppunit
-
-find_package(PkgConfig)
-pkg_check_modules(PC_CppUnit QUIET cppunit)
-
# ------------------------------------------------------------------------
# Search for CppUnit include DIR
# ------------------------------------------------------------------------
diff --git a/cmake/FindIlmBase.cmake b/cmake/FindIlmBase.cmake
index f0a0d7f..9f31355 100644
--- a/cmake/FindIlmBase.cmake
+++ b/cmake/FindIlmBase.cmake
@@ -152,11 +152,6 @@ else()
endif()
endif()
-# Additionally try and use pkconfig to find IlmBase
-
-find_package(PkgConfig)
-pkg_check_modules(PC_IlmBase QUIET IlmBase)
-
# ------------------------------------------------------------------------
# Search for IlmBase include DIR
# ------------------------------------------------------------------------
diff --git a/cmake/FindLog4cplus.cmake b/cmake/FindLog4cplus.cmake
index 6890724..10dc931 100644
--- a/cmake/FindLog4cplus.cmake
+++ b/cmake/FindLog4cplus.cmake
@@ -106,11 +106,6 @@ else()
endif()
endif()
-# Additionally try and use pkconfig to find log4cplus
-
-find_package(PkgConfig)
-pkg_check_modules(PC_Log4cplus QUIET log4cplus)
-
# ------------------------------------------------------------------------
# Search for Log4cplus include DIR
# ------------------------------------------------------------------------
diff --git a/cmake/FindOpenEXR.cmake b/cmake/FindOpenEXR.cmake
index 302c1df..3d00c3d 100644
--- a/cmake/FindOpenEXR.cmake
+++ b/cmake/FindOpenEXR.cmake
@@ -145,11 +145,6 @@ else()
endif()
endif()
-# Additionally try and use pkconfig to find OpenEXR
-
-find_package(PkgConfig)
-pkg_check_modules(PC_OpenEXR QUIET OpenEXR)
-
# ------------------------------------------------------------------------
# Search for OpenEXR include DIR
# ------------------------------------------------------------------------
diff --git a/cmake/FindOpenVDB.cmake b/cmake/FindOpenVDB.cmake
index 783dfed..1fd43be 100644
--- a/cmake/FindOpenVDB.cmake
+++ b/cmake/FindOpenVDB.cmake
@@ -153,11 +153,6 @@ else()
endif()
endif()
-# Additionally try and use pkconfig to find OpenVDB
-
-find_package(PkgConfig)
-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 01696ce..8fe73e5 100644
--- a/cmake/FindTBB.cmake
+++ b/cmake/FindTBB.cmake
@@ -141,11 +141,6 @@ else()
endif()
endif()
-# Additionally try and use pkconfig to find Tbb
-
-find_package(PkgConfig)
-pkg_check_modules(PC_Tbb QUIET tbb)
-
# ------------------------------------------------------------------------
# Search for tbb include DIR
# ------------------------------------------------------------------------
diff --git a/cmake/OpenVDBGLFW3Setup.cmake b/cmake/OpenVDBGLFW3Setup.cmake
index 3a29dc7..4dc6269 100644
--- a/cmake/OpenVDBGLFW3Setup.cmake
+++ b/cmake/OpenVDBGLFW3Setup.cmake
@@ -77,12 +77,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
-find_package(PkgConfig)
-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,14 +0,0 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b35ec70..801e7df 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -38,6 +38,9 @@ if(CCACHE_FOUND)
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
endif(CCACHE_FOUND)
+OPTION ( OPENVDB_BUILD_TOOLS "Build OpenVDB utilities" OFF )
+OPTION ( OPENVDB_STATIC "Build statically linked library" OFF )
+OPTION ( OPENVDB_SHARED "Build dynamically linked library" ON )
OPTION ( OPENVDB_BUILD_UNITTESTS "Build the OpenVDB unit tests" ON )
OPTION ( OPENVDB_BUILD_DOCS "Build the OpenVDB documentation" OFF )
OPTION ( OPENVDB_BUILD_PYTHON_MODULE "Build the pyopenvdb Python module" ON )

File diff suppressed because it is too large Load Diff

View File

@ -1,282 +0,0 @@
diff --git a/openvdb/CMakeLists.txt b/openvdb/CMakeLists.txt
index 9404dbc..94daf8c 100644
--- a/openvdb/CMakeLists.txt
+++ b/openvdb/CMakeLists.txt
@@ -29,28 +29,31 @@ PROJECT ( OpenVDBCore )
set(CMAKE_CXX_STANDARD 11)
+IF ( OPENVDB_BUILD_TOOLS )
IF ( USE_GLFW3 )
FIND_PACKAGE ( GLFW3 REQUIRED )
SET ( OPENVDB_USE_GLFW_FLAG "-DOPENVDB_USE_GLFW_3" )
IF ( UNIX AND NOT APPLE )
- SET ( GLFW_DEPENDENT_LIBRARIES "X11;Xi;Xrandr;Xinerama;Xcursor;Xxf86vm" )
- ENDIF ( UNIX AND NOT APPLE )
+ SET ( GLFW_DEPENDENT_LIBRARIES "X11;Xi;Xrandr;Xinerama;Xcursor;Xxf86vm" )
+ ENDIF ()
SET ( GLFW_LINK_LIBRARY ${GLFW3_glfw_LIBRARY} )
SET ( GLFW_INCLUDE_DIRECTORY ${GLFW3_INCLUDE_DIR} CACHE STRING "GLFW3 include directory")
ELSE ()
FIND_PACKAGE ( GLFW REQUIRED )
IF ( UNIX AND NOT APPLE )
- SET ( GLFW_DEPENDENT_LIBRARIES "X11;Xi;Xrandr;Xinerama;Xcursor;Xxf86vm" )
+ SET ( GLFW_DEPENDENT_LIBRARIES "X11;Xi;Xrandr;Xinerama;Xcursor;Xxf86vm" )
ENDIF ()
SET ( GLFW_LINK_LIBRARY ${GLFW_glfw_LIBRARY} )
SET ( GLFW_INCLUDE_DIRECTORY ${GLFW_INCLUDE_DIR} CACHE STRING "GLFW include directory")
ENDIF ()
+ENDIF ()
+IF ( OPENVDB_BUILD_TOOLS )
IF (WIN32)
FIND_PACKAGE ( GLEW REQUIRED )
-ELSE ()
- FIND_PACKAGE ( Threads REQUIRED )
-ENDIF()
+ENDIF ()
+ENDIF ()
+FIND_PACKAGE ( Threads REQUIRED )
# Determine OpenVDB version
#define OPENVDB_LIBRARY_MAJOR_VERSION_NUMBER 4
@@ -130,7 +133,12 @@ INCLUDE_DIRECTORIES ( SYSTEM ${BLOSC_INCLUDE_DIR} )
INCLUDE_DIRECTORIES ( SYSTEM ${CPPUNIT_INCLUDE_DIR} )
IF (WIN32)
- ADD_DEFINITIONS ( -D_WIN32 -DNOMINMAX -DHALF_EXPORTS -DOPENVDB_DLL )
+ ADD_DEFINITIONS ( -D__TBB_NO_IMPLICIT_LINKAGE )
+ ADD_DEFINITIONS ( -D__TBBMALLOC_NO_IMPLICIT_LINKAGE )
+ ADD_DEFINITIONS ( -D_WIN32 -DNOMINMAX )
+ IF ( OPENVDB_SHARED )
+ ADD_DEFINITIONS ( -DOPENEXR_DLL -DOPENVDB_DLL )
+ ENDIF ()
ELSE ()
ADD_DEFINITIONS ( -pthread -fPIC )
ENDIF ()
@@ -170,16 +178,21 @@ SET ( OPENVDB_LIBRARY_SOURCE_FILES
SET_SOURCE_FILES_PROPERTIES ( ${OPENVDB_LIBRARY_SOURCE_FILES}
PROPERTIES
- COMPILE_FLAGS "-DOPENVDB_PRIVATE -DOPENVDB_USE_BLOSC ${OPENVDB_USE_GLFW_FLAG}"
+ COMPILE_FLAGS "-DOPENVDB_PRIVATE -DOPENVDB_USE_BLOSC ${OPENVDB_USE_GLFW_FLAG} $<$<CXX_COMPILER_ID:MSVC>:/bigobj>"
)
-
+
+IF ( OPENVDB_STATIC )
ADD_LIBRARY ( openvdb_static STATIC
${OPENVDB_LIBRARY_SOURCE_FILES}
)
+ENDIF ()
+IF ( OPENVDB_SHARED )
ADD_LIBRARY ( openvdb_shared SHARED
${OPENVDB_LIBRARY_SOURCE_FILES}
)
+ENDIF ()
+IF ( OPENVDB_STATIC )
TARGET_LINK_LIBRARIES ( openvdb_static
${Boost_IOSTREAMS_LIBRARY}
${Boost_SYSTEM_LIBRARY}
@@ -188,6 +201,8 @@ TARGET_LINK_LIBRARIES ( openvdb_static
${ZLIB_LIBRARY}
${BLOSC_blosc_LIBRARY}
)
+ENDIF ()
+IF ( OPENVDB_SHARED )
TARGET_LINK_LIBRARIES ( openvdb_shared
${Boost_IOSTREAMS_LIBRARY}
${Boost_SYSTEM_LIBRARY}
@@ -196,7 +211,9 @@ TARGET_LINK_LIBRARIES ( openvdb_shared
${ZLIB_LIBRARY}
${BLOSC_blosc_LIBRARY}
)
+ENDIF ()
+IF ( OPENVDB_STATIC )
IF (WIN32)
SET_TARGET_PROPERTIES ( openvdb_static
PROPERTIES OUTPUT_NAME libopenvdb
@@ -205,8 +222,10 @@ ELSE()
SET_TARGET_PROPERTIES ( openvdb_static
PROPERTIES OUTPUT_NAME openvdb
)
-ENDIF()
+ENDIF ()
+ENDIF ()
+IF ( OPENVDB_SHARED )
SET_TARGET_PROPERTIES(
openvdb_shared
PROPERTIES
@@ -214,13 +233,15 @@ SET_TARGET_PROPERTIES(
SOVERSION ${OPENVDB_MAJOR_VERSION_NUMBER}.${OPENVDB_MINOR_VERSION_NUMBER}
VERSION ${OPENVDB_MAJOR_VERSION_NUMBER}.${OPENVDB_MINOR_VERSION_NUMBER}.${OPENVDB_PATCH_VERSION_NUMBER}
)
+ENDIF ()
SET ( VDB_PRINT_SOURCE_FILES cmd/openvdb_print/main.cc )
SET_SOURCE_FILES_PROPERTIES ( ${VDB_PRINT_SOURCE_FILES}
PROPERTIES
- COMPILE_FLAGS "-DOPENVDB_USE_BLOSC ${OPENVDB_USE_GLFW_FLAG}"
+ COMPILE_FLAGS "-DOPENVDB_USE_BLOSC ${OPENVDB_USE_GLFW_FLAG} $<$<CXX_COMPILER_ID:MSVC>:/bigobj>"
)
+IF ( OPENVDB_BUILD_TOOLS )
ADD_EXECUTABLE ( vdb_print
${VDB_PRINT_SOURCE_FILES}
)
@@ -229,14 +250,19 @@ TARGET_LINK_LIBRARIES ( vdb_print
openvdb_shared
${CMAKE_THREAD_LIBS_INIT}
${BLOSC_blosc_LIBRARY}
+ )
+
+IF (NOT WIN32)
+TARGET_LINK_LIBRARIES ( vdb_print
m
stdc++
)
+ENDIF ()
SET ( VDB_RENDER_SOURCE_FILES cmd/openvdb_render/main.cc )
SET_SOURCE_FILES_PROPERTIES ( ${VDB_RENDER_SOURCE_FILES}
PROPERTIES
- COMPILE_FLAGS "-DOPENVDB_USE_BLOSC ${OPENVDB_USE_GLFW_FLAG}"
+ COMPILE_FLAGS "-DOPENVDB_USE_BLOSC ${OPENVDB_USE_GLFW_FLAG} $<$<CXX_COMPILER_ID:MSVC>:/bigobj>"
)
ADD_EXECUTABLE ( vdb_render
${VDB_RENDER_SOURCE_FILES}
@@ -249,9 +275,14 @@ TARGET_LINK_LIBRARIES ( vdb_render
${Openexr_ILMIMF_LIBRARY}
${Ilmbase_ILMTHREAD_LIBRARY}
${Ilmbase_IEX_LIBRARY}
+ )
+
+IF (NOT WIN32)
+TARGET_LINK_LIBRARIES ( vdb_render
m
stdc++
)
+ENDIF ()
SET ( VDB_VIEW_SOURCE_FILES
cmd/openvdb_view/main.cc
@@ -263,29 +294,38 @@ SET ( VDB_VIEW_SOURCE_FILES
)
SET_SOURCE_FILES_PROPERTIES ( ${VDB_VIEW_SOURCE_FILES}
PROPERTIES
- COMPILE_FLAGS "-DOPENVDB_USE_BLOSC ${OPENVDB_USE_GLFW_FLAG} -DGL_GLEXT_PROTOTYPES=1"
+ COMPILE_FLAGS "-DOPENVDB_USE_BLOSC ${OPENVDB_USE_GLFW_FLAG} -DGL_GLEXT_PROTOTYPES=1 $<$<CXX_COMPILER_ID:MSVC>:/bigobj>"
+ )
+
+ADD_EXECUTABLE ( vdb_view
+ ${VDB_VIEW_SOURCE_FILES}
)
-IF (NOT WIN32)
- ADD_EXECUTABLE ( vdb_view
- ${VDB_VIEW_SOURCE_FILES}
- )
- target_include_directories ( vdb_view SYSTEM PRIVATE ${Boost_INCLUDE_DIR} )
+target_include_directories ( vdb_view SYSTEM PRIVATE ${Boost_INCLUDE_DIR} )
- TARGET_LINK_LIBRARIES ( vdb_view
- openvdb_shared
- ${Boost_THREAD_LIBRARY}
- ${OPENGL_gl_LIBRARY}
- ${OPENGL_glu_LIBRARY}
- ${COCOA_LIBRARY}
- ${IOKIT_LIBRARY}
- ${COREVIDEO_LIBRARY}
- ${GLFW_LINK_LIBRARY}
- ${GLFW_DEPENDENT_LIBRARIES}
- ${GLEW_GLEW_LIBRARY}
- m
- stdc++
- )
+TARGET_LINK_LIBRARIES ( vdb_view
+ openvdb_shared
+ ${Boost_LIBRARIES}
+ ${OPENGL_gl_LIBRARY}
+ ${OPENGL_glu_LIBRARY}
+ ${GLFW_LINK_LIBRARY}
+ ${GLFW_DEPENDENT_LIBRARIES}
+ ${GLEW_GLEW_LIBRARY}
+ )
+IF (APPLE)
+TARGET_LINK_LIBRARIES ( vdb_view
+ ${COCOA_LIBRARY}
+ ${IOKIT_LIBRARY}
+ ${COREVIDEO_LIBRARY}
+)
+ENDIF ()
+IF (NOT WIN32)
+TARGET_LINK_LIBRARIES ( vdb_view
+ m
+ stdc++
+ )
+
+ENDIF ()
ENDIF ()
SET ( UNITTEST_SOURCE_FILES
@@ -398,7 +438,7 @@ IF ( OPENVDB_BUILD_UNITTESTS )
ADD_TEST ( vdb_unit_test vdb_test )
-ENDIF (OPENVDB_BUILD_UNITTESTS)
+ENDIF ()
# Doxygen docmentation
IF (OPENVDB_BUILD_DOCS)
@@ -419,26 +459,29 @@ IF (OPENVDB_BUILD_DOCS)
ENDIF ()
# Installation
-IF ( NOT WIN32 )
+IF ( OPENVDB_BUILD_TOOLS )
INSTALL ( TARGETS
vdb_view
DESTINATION
bin
)
+ INSTALL ( TARGETS
+ vdb_print
+ vdb_render
+ DESTINATION
+ bin
+ )
ENDIF ()
-INSTALL ( TARGETS
- vdb_print
- vdb_render
- DESTINATION
- bin
- )
-INSTALL ( TARGETS
- openvdb_static
- DESTINATION
- lib
- )
+IF ( OPENVDB_STATIC)
+ INSTALL ( TARGETS
+ openvdb_static
+ DESTINATION
+ lib
+ )
+ENDIF ()
+IF ( OPENVDB_SHARED )
IF (WIN32)
INSTALL ( TARGETS
openvdb_shared
@@ -452,6 +495,7 @@ ELSE()
lib
)
ENDIF ()
+ENDIF ()
INSTALL ( DIRECTORY ${PROJECT_SOURCE_DIR} DESTINATION include
FILES_MATCHING PATTERN "*.h"

View File

@ -0,0 +1,90 @@
diff --git a/openvdb/CMakeLists.txt b/openvdb/CMakeLists.txt
index b84d3e6..524a59e 100644
--- a/openvdb/CMakeLists.txt
+++ b/openvdb/CMakeLists.txt
@@ -71,13 +71,13 @@ message(STATUS "----------------------------------------------------")
# Collect and configure lib dependencies
if(USE_EXR)
- find_package(IlmBase ${MINIMUM_ILMBASE_VERSION} REQUIRED)
- find_package(OpenEXR ${MINIMUM_OPENEXR_VERSION} REQUIRED)
+ 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()
-find_package(TBB ${MINIMUM_TBB_VERSION} REQUIRED COMPONENTS tbb)
+find_package(TBB CONFIG REQUIRED)
find_package(ZLIB ${MINIMUM_ZLIB_VERSION} REQUIRED)
if(USE_LOG4CPLUS)
@@ -115,15 +115,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()
@@ -135,7 +135,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
@@ -160,7 +160,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
@@ -374,6 +378,7 @@ list(APPEND OPENVDB_CORE_PRIVATE_DEFINES "-DOPENVDB_PRIVATE")
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
diff --git a/openvdb/cmd/CMakeLists.txt b/openvdb/cmd/CMakeLists.txt
index 124bc3c..d58b3fe 100644
--- a/openvdb/cmd/CMakeLists.txt
+++ b/openvdb/cmd/CMakeLists.txt
@@ -155,9 +155,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}
)

View File

@ -1,59 +0,0 @@
diff --git a/openvdb/viewer/ClipBox.h b/openvdb/viewer/ClipBox.h
index ad62d39..c68c5be 100644
--- a/openvdb/viewer/ClipBox.h
+++ b/openvdb/viewer/ClipBox.h
@@ -37,6 +37,7 @@
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#else
+#include <windows.h>
#include <GL/gl.h>
#include <GL/glu.h>
#endif
diff --git a/openvdb/viewer/Font.h b/openvdb/viewer/Font.h
index da62993..b341165 100644
--- a/openvdb/viewer/Font.h
+++ b/openvdb/viewer/Font.h
@@ -37,6 +37,7 @@
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#else
+#include <windows.h>
#include <GL/gl.h>
#include <GL/glu.h>
#endif
diff --git a/openvdb/viewer/RenderModules.h b/openvdb/viewer/RenderModules.h
index b9fa5b1..fd38a50 100644
--- a/openvdb/viewer/RenderModules.h
+++ b/openvdb/viewer/RenderModules.h
@@ -31,6 +31,7 @@
#ifndef OPENVDB_VIEWER_RENDERMODULES_HAS_BEEN_INCLUDED
#define OPENVDB_VIEWER_RENDERMODULES_HAS_BEEN_INCLUDED
+#include <GL/glew.h>
#include <openvdb/openvdb.h>
#include <openvdb/tools/VolumeToMesh.h>
#include <openvdb/tools/MeshToVolume.h>
@@ -41,6 +42,7 @@
#include <vector>
#if defined(__APPLE__) || defined(MACOSX)
+#include <windows.h>
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#else
diff --git a/openvdb/viewer/Viewer.cc b/openvdb/viewer/Viewer.cc
index 31bb7a4..88bd308 100644
--- a/openvdb/viewer/Viewer.cc
+++ b/openvdb/viewer/Viewer.cc
@@ -31,9 +31,9 @@
#include "Viewer.h"
#include "Camera.h"
+#include "RenderModules.h"
#include "ClipBox.h"
#include "Font.h"
-#include "RenderModules.h"
#include <openvdb/util/Formats.h> // for formattedInt()
#include <openvdb/util/logging.h>
#include <openvdb/points/PointDataGrid.h>

View File

@ -1,6 +1,6 @@
Source: openvdb
Version: 6.0.0-2
Build-Depends: boost-ptr-container, openexr, tbb, blosc, boost-iostreams, boost-system, boost-thread, boost-date-time, boost-any, boost-uuid, boost-interprocess
Version: 6.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,24 +0,0 @@
diff --git a/cmake/FindBlosc.cmake b/cmake/FindBlosc.cmake
index 5ac3780c..61ba83bc 100644
--- a/cmake/FindBlosc.cmake
+++ b/cmake/FindBlosc.cmake
@@ -45,8 +45,8 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS ( Blosc
IF ( BLOSC_FOUND )
- SET ( BLOSC_LIBRARYDIR ${BLOSC_LOCATION}/lib
- CACHE STRING "Blosc library directories")
+# SET ( BLOSC_LIBRARYDIR ${BLOSC_LOCATION}/lib
+# CACHE STRING "Blosc library directories")
SET ( _blosc_library_name "blosc" )
@@ -61,8 +61,6 @@ IF ( BLOSC_FOUND )
ENDIF()
FIND_LIBRARY ( BLOSC_blosc_LIBRARY ${_blosc_library_name}
- PATHS ${BLOSC_LIBRARYDIR}
- NO_DEFAULT_PATH
NO_SYSTEM_ENVIRONMENT_PATH
)

View File

@ -3,15 +3,13 @@ include(vcpkg_common_functions)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO AcademySoftwareFoundation/openvdb
REF v6.0.0
SHA512 6b9e267fff46647b39e1e6faa12059442196c1858df1fda1515cfc375e25bc3033e2828c80e63a652509cfba386376e022cebf81ec85aaccece421b0c721529b
REF v6.1.0
SHA512 99ebbb50104ef87792ab73989e8714c4f283fb02d04c3033126b5f0d927ff7bbdebe35c8214ded841692941d8ed8ae551fd6d1bf90ad7dc07bedc3b38b9c4b38
HEAD_REF master
PATCHES
0001-fix-cmake-modules.patch
0002-add-custom-options.patch
0003-build-only-necessary-targets.patch
0004-add-necessary-head.patch
blosc.patch
0001-remove-pkgconfig.patch
0002-fix-cmake-modules.patch
0003-fix-cmake.patch
)
if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
@ -38,29 +36,36 @@ vcpkg_configure_cmake(
-DOPENVDB_BUILD_PYTHON_MODULE=OFF
-DOPENVDB_ENABLE_3_ABI_COMPATIBLE=OFF
-DUSE_GLFW3=ON
-DOPENVDB_STATIC=${OPENVDB_STATIC}
-DOPENVDB_SHARED=${OPENVDB_SHARED}
-DOPENVDB_BUILD_TOOLS=${OPENVDB_BUILD_TOOLS}
-DOPENVDB_CORE_STATIC=${OPENVDB_STATIC}
-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_LOD=${OPENVDB_BUILD_TOOLS}
)
vcpkg_install_cmake()
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/OpenVDB TARGET_PATH share/openvdb)
vcpkg_copy_pdbs()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
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)
#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_render.exe)
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/vdb_print.exe)
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/vdb_view.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)
endif()
# Handle copyright