[Bf-blender-cvs] [0495842ea54] temp-sybren-usd-patch-02: USD: build & install USD with 'make deps'

Sybren A. Stüvel noreply at git.blender.org
Thu Nov 28 17:54:46 CET 2019


Commit: 0495842ea540f7e4d8c00207e0e8ab0daad15c34
Author: Sybren A. Stüvel
Date:   Fri Nov 22 10:33:06 2019 +0100
Branches: temp-sybren-usd-patch-02
https://developer.blender.org/rB0495842ea540f7e4d8c00207e0e8ab0daad15c34

USD: build & install USD with 'make deps'

===================================================================

M	build_files/build_environment/CMakeLists.txt
A	build_files/build_environment/cmake/usd.cmake
M	build_files/build_environment/cmake/versions.cmake
A	build_files/build_environment/patches/usd.diff

===================================================================

diff --git a/build_files/build_environment/CMakeLists.txt b/build_files/build_environment/CMakeLists.txt
index cdfa18ff4ff..fb32d2218b8 100644
--- a/build_files/build_environment/CMakeLists.txt
+++ b/build_files/build_environment/CMakeLists.txt
@@ -92,6 +92,7 @@ include(cmake/python.cmake)
 include(cmake/python_site_packages.cmake)
 include(cmake/package_python.cmake)
 include(cmake/numpy.cmake)
+include(cmake/usd.cmake)
 if(UNIX AND NOT APPLE)
   # Rely on PugiXML compiled with OpenImageIO
 else()
diff --git a/build_files/build_environment/cmake/usd.cmake b/build_files/build_environment/cmake/usd.cmake
new file mode 100644
index 00000000000..2f409fb9a84
--- /dev/null
+++ b/build_files/build_environment/cmake/usd.cmake
@@ -0,0 +1,68 @@
+# ***** 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(USD_EXTRA_ARGS
+  -DBoost_COMPILER:STRING=${BOOST_COMPILER_STRING}
+  -DBoost_USE_MULTITHREADED=ON
+  -DBoost_USE_STATIC_LIBS=ON
+  -DBoost_USE_STATIC_RUNTIME=OFF
+  -DBOOST_ROOT=${LIBDIR}/boost
+  -DTBB_INCLUDE_DIRS=${LIBDIR}/tbb/include
+  -DTBB_LIBRARIES=${LIBDIR}/tbb/lib/${LIBPREFIX}tbb_static${LIBEXT}
+  -DTbb_TBB_LIBRARY=${LIBDIR}/tbb/lib/${LIBPREFIX}tbb_static${LIBEXT}
+  -DPXR_ENABLE_PYTHON_SUPPORT=OFF
+  -DPXR_BUILD_IMAGING=OFF
+  -DPXR_BUILD_TESTS=OFF
+  -DBUILD_SHARED_LIBS=OFF
+  -DPYTHON_EXECUTABLE=${PYTHON_BINARY}
+  -DCMAKE_DEBUG_POSTFIX=_d
+)
+
+ExternalProject_Add(external_usd
+  URL ${USD_URI}
+  DOWNLOAD_DIR ${DOWNLOAD_DIR}
+  URL_HASH MD5=${USD_HASH}
+  PREFIX ${BUILD_DIR}/usd
+  PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/usd/src/external_usd < ${PATCH_DIR}/usd.diff
+  CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/usd -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${USD_EXTRA_ARGS}
+  INSTALL_DIR ${LIBDIR}/usd
+)
+
+add_dependencies(
+  external_usd
+  external_tbb
+  external_boost
+  external_python
+)
+
+if(WIN32)
+  if(BUILD_MODE STREQUAL Release)
+    ExternalProject_Add_Step(external_usd after_install
+      COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/usd/ ${HARVEST_TARGET}/usd
+      DEPENDEES install
+    )
+  endif()
+  if(BUILD_MODE STREQUAL Debug)
+    ExternalProject_Add_Step(external_usd after_install
+      COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/usd/lib ${HARVEST_TARGET}/usd/lib
+      DEPENDEES install
+    )
+  endif()
+
+endif()
+
diff --git a/build_files/build_environment/cmake/versions.cmake b/build_files/build_environment/cmake/versions.cmake
index 9cbf104e842..2b08a74c1aa 100644
--- a/build_files/build_environment/cmake/versions.cmake
+++ b/build_files/build_environment/cmake/versions.cmake
@@ -307,6 +307,10 @@ set(EMBREE_VERSION 3.2.4)
 set(EMBREE_URI https://github.com/embree/embree/archive/v${EMBREE_VERSION}.zip)
 set(EMBREE_HASH 3d4a1147002ff43939d45140aa9d6fb8)
 
+set(USD_VERSION 19.11)
+set(USD_URI https://github.com/PixarAnimationStudios/USD/archive/v${USD_VERSION}.tar.gz)
+set(USD_HASH 79ff176167b3fe85f4953abd6cc5e0cc)
+
 set(OIDN_VERSION 1.0.0)
 set(OIDN_URI https://github.com/OpenImageDenoise/oidn/releases/download/v${OIDN_VERSION}/oidn-${OIDN_VERSION}.src.zip)
 set(OIDN_HASH 19fe67b0164e8f020ac8a4f520defe60)
diff --git a/build_files/build_environment/patches/usd.diff b/build_files/build_environment/patches/usd.diff
new file mode 100644
index 00000000000..69e6f335ea5
--- /dev/null
+++ b/build_files/build_environment/patches/usd.diff
@@ -0,0 +1,22 @@
+diff -Naur usd.orig/cmake/defaults/Packages.cmake external_usd/cmake/defaults/Packages.cmake
+--- usd.orig/cmake/defaults/Packages.cmake	2019-06-17 16:56:45 -0600
++++ external_usd/cmake/defaults/Packages.cmake	2019-07-19 14:58:06 -0600
+@@ -64,7 +64,7 @@
+ endif()
+ 
+ # --TBB
+-find_package(TBB REQUIRED COMPONENTS tbb)
++find_package(TBB)
+ add_definitions(${TBB_DEFINITIONS})
+ 
+ # --math
+diff -Naur usd.orig/pxr/usd/CMakeLists.txt external_usd/pxr/usd/CMakeLists.txt
+--- usd.orig/pxr/usd/CMakeLists.txt	2019-06-17 16:56:45 -0600
++++ external_usd/pxr/usd/CMakeLists.txt	2019-07-19 15:08:15 -0600
+@@ -1,6 +1,5 @@
+ set(DIRS
+     lib
+-    bin
+     plugin
+ )
+



More information about the Bf-blender-cvs mailing list