diff options
Diffstat (limited to 'build_files/build_environment')
-rw-r--r-- | build_files/build_environment/CMakeLists.txt | 1 | ||||
-rw-r--r-- | build_files/build_environment/cmake/harvest.cmake | 4 | ||||
-rw-r--r-- | build_files/build_environment/cmake/nanovdb.cmake | 54 | ||||
-rw-r--r-- | build_files/build_environment/cmake/openvdb.cmake | 28 | ||||
-rw-r--r-- | build_files/build_environment/cmake/options.cmake | 1 | ||||
-rw-r--r-- | build_files/build_environment/cmake/versions.cmake | 16 | ||||
-rw-r--r-- | build_files/build_environment/patches/openvdb_nanovdb.diff | 135 |
7 files changed, 64 insertions, 175 deletions
diff --git a/build_files/build_environment/CMakeLists.txt b/build_files/build_environment/CMakeLists.txt index 59c15a03119..0bc85f20c16 100644 --- a/build_files/build_environment/CMakeLists.txt +++ b/build_files/build_environment/CMakeLists.txt @@ -85,6 +85,7 @@ include(cmake/flexbison.cmake) include(cmake/osl.cmake) include(cmake/tbb.cmake) include(cmake/openvdb.cmake) +include(cmake/nanovdb.cmake) include(cmake/python.cmake) include(cmake/python_site_packages.cmake) include(cmake/package_python.cmake) diff --git a/build_files/build_environment/cmake/harvest.cmake b/build_files/build_environment/cmake/harvest.cmake index 1fb56c4d568..1c5354aeb42 100644 --- a/build_files/build_environment/cmake/harvest.cmake +++ b/build_files/build_environment/cmake/harvest.cmake @@ -146,10 +146,8 @@ harvest(openjpeg/lib openjpeg/lib "*.a") harvest(opensubdiv/include opensubdiv/include "*.h") harvest(opensubdiv/lib opensubdiv/lib "*.a") harvest(openvdb/include/openvdb openvdb/include/openvdb "*.h") -if(WITH_NANOVDB) - harvest(openvdb/nanovdb nanovdb/include/nanovdb "*.h") -endif() harvest(openvdb/lib openvdb/lib "*.a") +harvest(nanovdb/nanovdb nanovdb/include/nanovdb "*.h") harvest(xr_openxr_sdk/include/openxr xr_openxr_sdk/include/openxr "*.h") harvest(xr_openxr_sdk/lib xr_openxr_sdk/lib "*.a") harvest(osl/bin osl/bin "oslc") diff --git a/build_files/build_environment/cmake/nanovdb.cmake b/build_files/build_environment/cmake/nanovdb.cmake new file mode 100644 index 00000000000..89e7c38642d --- /dev/null +++ b/build_files/build_environment/cmake/nanovdb.cmake @@ -0,0 +1,54 @@ +# ***** BEGIN GPL LICENSE BLOCK ***** +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# ***** END GPL LICENSE BLOCK ***** + +set(NANOVDB_EXTRA_ARGS + # NanoVDB is header-only, so only need the install target + -DNANOVDB_BUILD_UNITTESTS=OFF + -DNANOVDB_BUILD_EXAMPLES=OFF + -DNANOVDB_BUILD_BENCHMARK=OFF + -DNANOVDB_BUILD_DOCS=OFF + -DNANOVDB_BUILD_TOOLS=OFF + -DNANOVDB_CUDA_KEEP_PTX=OFF + # Do not need to include any of the dependencies because of this + -DNANOVDB_USE_OPENVDB=OFF + -DNANOVDB_USE_OPENGL=OFF + -DNANOVDB_USE_OPENCL=OFF + -DNANOVDB_USE_CUDA=OFF + -DNANOVDB_USE_TBB=OFF + -DNANOVDB_USE_BLOSC=OFF + -DNANOVDB_USE_ZLIB=OFF + -DNANOVDB_USE_OPTIX=OFF + -DNANOVDB_ALLOW_FETCHCONTENT=OFF +) + +ExternalProject_Add(nanovdb + URL ${NANOVDB_URI} + DOWNLOAD_DIR ${DOWNLOAD_DIR} + URL_HASH MD5=${NANOVDB_HASH} + PREFIX ${BUILD_DIR}/nanovdb + SOURCE_SUBDIR nanovdb + CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/nanovdb ${DEFAULT_CMAKE_FLAGS} ${NANOVDB_EXTRA_ARGS} + INSTALL_DIR ${LIBDIR}/nanovdb +) + +if(WIN32) + ExternalProject_Add_Step(nanovdb after_install + COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/nanovdb/nanovdb ${HARVEST_TARGET}/nanovdb/include/nanovdb + DEPENDEES install + ) +endif() diff --git a/build_files/build_environment/cmake/openvdb.cmake b/build_files/build_environment/cmake/openvdb.cmake index 07d0297d5aa..2962f085e1b 100644 --- a/build_files/build_environment/cmake/openvdb.cmake +++ b/build_files/build_environment/cmake/openvdb.cmake @@ -54,20 +54,6 @@ set(OPENVDB_EXTRA_ARGS -DOPENVDB_CORE_STATIC=${OPENVDB_STATIC} -DOPENVDB_BUILD_BINARIES=Off -DCMAKE_DEBUG_POSTFIX=_d - # NanoVDB is header-only, so only need the install target - -DNANOVDB_BUILD_UNITTESTS=OFF - -DNANOVDB_BUILD_EXAMPLES=OFF - -DNANOVDB_BUILD_BENCHMARK=OFF - -DNANOVDB_BUILD_DOCS=OFF - -DNANOVDB_BUILD_TOOLS=OFF - -DNANOVDB_CUDA_KEEP_PTX=OFF - -DNANOVDB_USE_OPENGL=OFF - -DNANOVDB_USE_OPENGL=OFF - -DNANOVDB_USE_CUDA=OFF - -DNANOVDB_USE_TBB=OFF - -DNANOVDB_USE_OPTIX=OFF - -DNANOVDB_USE_OPENVDB=OFF - -DNANOVDB_ALLOW_FETCHCONTENT=OFF ) if(WIN32) @@ -88,18 +74,12 @@ else() ) endif() -if(WITH_NANOVDB) - set(OPENVDB_PATCH_FILE openvdb_nanovdb.diff) -else() - set(OPENVDB_PATCH_FILE openvdb.diff) -endif() - ExternalProject_Add(openvdb URL ${OPENVDB_URI} DOWNLOAD_DIR ${DOWNLOAD_DIR} URL_HASH MD5=${OPENVDB_HASH} PREFIX ${BUILD_DIR}/openvdb - PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/openvdb/src/openvdb < ${PATCH_DIR}/${OPENVDB_PATCH_FILE} + PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/openvdb/src/openvdb < ${PATCH_DIR}/openvdb.diff CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openvdb ${DEFAULT_CMAKE_FLAGS} ${OPENVDB_EXTRA_ARGS} INSTALL_DIR ${LIBDIR}/openvdb ) @@ -121,12 +101,6 @@ if(WIN32) COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openvdb/bin/openvdb.dll ${HARVEST_TARGET}/openvdb/bin/openvdb.dll DEPENDEES install ) - if(WITH_NANOVDB) - ExternalProject_Add_Step(openvdb nanovdb_install - COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openvdb/nanovdb ${HARVEST_TARGET}/nanovdb/include/nanovdb - DEPENDEES after_install - ) - endif() endif() if(BUILD_MODE STREQUAL Debug) ExternalProject_Add_Step(openvdb after_install diff --git a/build_files/build_environment/cmake/options.cmake b/build_files/build_environment/cmake/options.cmake index d6b5762ccbc..29e2ffc7ed8 100644 --- a/build_files/build_environment/cmake/options.cmake +++ b/build_files/build_environment/cmake/options.cmake @@ -21,7 +21,6 @@ if(WIN32) endif() option(WITH_WEBP "Enable building of oiio with webp support" OFF) option(WITH_BOOST_PYTHON "Enable building of boost with python support" OFF) -option(WITH_NANOVDB "Enable building of OpenVDB with NanoVDB included" OFF) set(MAKE_THREADS 1 CACHE STRING "Number of threads to run make with") if(NOT BUILD_MODE) diff --git a/build_files/build_environment/cmake/versions.cmake b/build_files/build_environment/cmake/versions.cmake index 244ca6dd49f..653db9f740c 100644 --- a/build_files/build_environment/cmake/versions.cmake +++ b/build_files/build_environment/cmake/versions.cmake @@ -145,15 +145,13 @@ set(TBB_VERSION 2019_U9) set(TBB_URI https://github.com/oneapi-src/oneTBB/archive/${TBB_VERSION}.tar.gz) set(TBB_HASH 26263622e9187212ec240dcf01b66207) -if(WITH_NANOVDB) - set(OPENVDB_GIT_UID e62f7a0bf1e27397223c61ddeaaf57edf111b77f) - set(OPENVDB_URI https://github.com/AcademySoftwareFoundation/openvdb/archive/${OPENVDB_GIT_UID}.tar.gz) - set(OPENVDB_HASH 90919510bc6ccd630fedc56f748cb199) -else() - set(OPENVDB_VERSION 7.0.0) - set(OPENVDB_URI https://github.com/AcademySoftwareFoundation/openvdb/archive/v${OPENVDB_VERSION}.tar.gz) - set(OPENVDB_HASH fd6c4f168282f7e0e494d290cd531fa8) -endif() +set(OPENVDB_VERSION 7.0.0) +set(OPENVDB_URI https://github.com/AcademySoftwareFoundation/openvdb/archive/v${OPENVDB_VERSION}.tar.gz) +set(OPENVDB_HASH fd6c4f168282f7e0e494d290cd531fa8) + +set(NANOVDB_GIT_UID e62f7a0bf1e27397223c61ddeaaf57edf111b77f) +set(NANOVDB_URI https://github.com/AcademySoftwareFoundation/openvdb/archive/${NANOVDB_GIT_UID}.tar.gz) +set(NANOVDB_HASH 90919510bc6ccd630fedc56f748cb199) set(IDNA_VERSION 2.9) set(CHARDET_VERSION 3.0.4) diff --git a/build_files/build_environment/patches/openvdb_nanovdb.diff b/build_files/build_environment/patches/openvdb_nanovdb.diff deleted file mode 100644 index 50984e91f37..00000000000 --- a/build_files/build_environment/patches/openvdb_nanovdb.diff +++ /dev/null @@ -1,135 +0,0 @@ -diff -Naur orig/cmake/FindIlmBase.cmake openvdb/cmake/FindIlmBase.cmake ---- orig/cmake/FindIlmBase.cmake 2019-12-06 12:11:33 -0700 -+++ openvdb/cmake/FindIlmBase.cmake 2020-08-12 12:48:44 -0600 -@@ -217,6 +217,8 @@ - set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib") - endif() - list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES "${_IlmBase_Version_Suffix}.lib") -+ list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES "_s.lib") -+ list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES "_s_d.lib") - else() - if(ILMBASE_USE_STATIC_LIBS) - set(CMAKE_FIND_LIBRARY_SUFFIXES ".a") -diff -Naur orig/cmake/FindOpenEXR.cmake openvdb/cmake/FindOpenEXR.cmake ---- orig/cmake/FindOpenEXR.cmake 2019-12-06 12:11:33 -0700 -+++ openvdb/cmake/FindOpenEXR.cmake 2020-08-12 12:48:44 -0600 -@@ -210,6 +210,8 @@ - set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib") - endif() - list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES "${_OpenEXR_Version_Suffix}.lib") -+ list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES "_s.lib") -+ list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES "_s_d.lib") - else() - if(OPENEXR_USE_STATIC_LIBS) - set(CMAKE_FIND_LIBRARY_SUFFIXES ".a") -diff -Naur orig/openvdb/openvdb/CMakeLists.txt openvdb/openvdb/openvdb/CMakeLists.txt ---- orig/openvdb/openvdb/CMakeLists.txt 2019-12-06 12:11:33 -0700 -+++ openvdb/openvdb/openvdb/CMakeLists.txt 2020-08-12 14:12:26 -0600 -@@ -105,7 +105,9 @@ - # http://boost.2283326.n4.nabble.com/CMake-config-scripts-broken-in-1-70-td4708957.html - # https://github.com/boostorg/boost_install/commit/160c7cb2b2c720e74463865ef0454d4c4cd9ae7c - set(BUILD_SHARED_LIBS ON) -- set(Boost_USE_STATIC_LIBS OFF) -+ if(NOT WIN32) # blender links boost statically on windows -+ set(Boost_USE_STATIC_LIBS OFF) -+ endif() - endif() - - find_package(Boost ${MINIMUM_BOOST_VERSION} REQUIRED COMPONENTS iostreams system) -@@ -193,6 +195,7 @@ - if(OPENVDB_DISABLE_BOOST_IMPLICIT_LINKING) - add_definitions(-DBOOST_ALL_NO_LIB) - endif() -+ add_definitions(-D__TBB_NO_IMPLICIT_LINKAGE -DOPENVDB_OPENEXR_STATICLIB) - endif() - - # @todo Should be target definitions -@@ -383,7 +386,12 @@ - # imported targets. - - if(OPENVDB_CORE_SHARED) -- add_library(openvdb_shared SHARED ${OPENVDB_LIBRARY_SOURCE_FILES}) -+ if(WIN32) -+ configure_file(version.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc @ONLY) -+ add_library(openvdb_shared SHARED ${OPENVDB_LIBRARY_SOURCE_FILES} ${CMAKE_CURRENT_BINARY_DIR}/version.rc) -+ else() -+ add_library(openvdb_shared SHARED ${OPENVDB_LIBRARY_SOURCE_FILES}) -+ endif() - endif() - - if(OPENVDB_CORE_STATIC) -diff -Naur orig/openvdb/openvdb/version.rc.in openvdb/openvdb/openvdb/version.rc.in ---- orig/openvdb/openvdb/version.rc.in 1969-12-31 17:00:00 -0700 -+++ openvdb/openvdb/openvdb/version.rc.in 2020-08-12 14:15:01 -0600 -@@ -0,0 +1,48 @@ -+#include <winver.h> -+ -+#define VER_FILEVERSION @OpenVDB_MAJOR_VERSION@,@OpenVDB_MINOR_VERSION@,@OpenVDB_PATCH_VERSION@,0 -+#define VER_FILEVERSION_STR "@OpenVDB_MAJOR_VERSION@.@OpenVDB_MINOR_VERSION@.@OpenVDB_PATCH_VERSION@.0\0" -+ -+#define VER_PRODUCTVERSION @OpenVDB_MAJOR_VERSION@,@OpenVDB_MINOR_VERSION@,@OpenVDB_PATCH_VERSION@,0 -+#define VER_PRODUCTVERSION_STR "@OpenVDB_MAJOR_VERSION@.@OpenVDB_MINOR_VERSION@\0" -+ -+#ifndef DEBUG -+#define VER_DEBUG 0 -+#else -+#define VER_DEBUG VS_FF_DEBUG -+#endif -+ -+VS_VERSION_INFO VERSIONINFO -+FILEVERSION VER_FILEVERSION -+PRODUCTVERSION VER_PRODUCTVERSION -+FILEFLAGSMASK VS_FFI_FILEFLAGSMASK -+FILEFLAGS (VER_DEBUG) -+FILEOS VOS__WINDOWS32 -+FILETYPE VFT_DLL -+FILESUBTYPE VFT2_UNKNOWN -+BEGIN -+ BLOCK "StringFileInfo" -+ BEGIN -+ BLOCK "040904E4" -+ BEGIN -+ VALUE "FileDescription", "OpenVDB" -+ VALUE "FileVersion", VER_FILEVERSION_STR -+ VALUE "InternalName", "OpenVDB" -+ VALUE "ProductName", "OpenVDB" -+ VALUE "ProductVersion", VER_PRODUCTVERSION_STR -+ END -+ END -+ -+ BLOCK "VarFileInfo" -+ BEGIN -+ /* The following line should only be modified for localized versions. */ -+ /* It consists of any number of WORD,WORD pairs, with each pair */ -+ /* describing a language,codepage combination supported by the file. */ -+ /* */ -+ /* For example, a file might have values "0x409,1252" indicating that it */ -+ /* supports English language (0x409) in the Windows ANSI codepage (1252). */ -+ -+ VALUE "Translation", 0x409, 1252 -+ -+ END -+END -diff -Naur openvdb-original/CMakeLists.txt openvdb/CMakeLists.txt ---- openvdb-original/CMakeLists.txt 2020-08-27 03:34:02.000000000 +0200 -+++ openvdb/CMakeLists.txt 2020-09-02 10:56:21.665735244 +0200 -@@ -68,6 +68,7 @@ - option(OPENVDB_INSTALL_HOUDINI_PYTHONRC [=[Install a Houdini startup script that sets - the visibilty of OpenVDB nodes and their native equivalents.]=] OFF) - option(OPENVDB_BUILD_MAYA_PLUGIN "Build the Maya plugin" OFF) -+option(OPENVDB_BUILD_NANOVDB "Build nanovdb" ON) - option(OPENVDB_ENABLE_RPATH "Build with RPATH information" ON) - option(OPENVDB_CXX_STRICT "Enable or disable pre-defined compiler warnings" OFF) - option(OPENVDB_CODE_COVERAGE "Enable code coverage. This also overrides CMAKE_BUILD_TYPE to Debug" OFF) -@@ -740,6 +741,10 @@ - add_subdirectory(openvdb_maya) - endif() - -+if(OPENVDB_BUILD_NANOVDB) -+ add_subdirectory(nanovdb) -+endif() -+ - ########################################################################## - - add_custom_target(uninstall -
\ No newline at end of file |