[Bf-blender-cvs] [e7c6b244c9d] blender2.8: Build: add scripts to build dependencies for Windows and macOS.

Brecht Van Lommel noreply at git.blender.org
Mon Aug 7 17:54:11 CEST 2017


Commit: e7c6b244c9db0892b4214f0795bec8c60d7ab4f0
Author: Brecht Van Lommel
Date:   Tue Jul 25 16:37:55 2017 +0200
Branches: blender2.8
https://developer.blender.org/rBe7c6b244c9db0892b4214f0795bec8c60d7ab4f0

Build: add scripts to build dependencies for Windows and macOS.

Note these are intended for platform maintainers, we do not intend to
support users making their own builds with these. For that precompiled
libraries from lib/ should be used.

Implemented by Martijn Berger, Ray Molenkamp and Brecht Van Lommel.

Differential Revision: https://developer.blender.org/D2753

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

M	.gitignore
M	GNUmakefile
A	build_files/build_environment/CMakeLists.txt
A	build_files/build_environment/cmake/alembic.cmake
A	build_files/build_environment/cmake/blendthumb.cmake
A	build_files/build_environment/cmake/blosc.cmake
A	build_files/build_environment/cmake/boost.cmake
A	build_files/build_environment/cmake/clang.cmake
A	build_files/build_environment/cmake/clew.cmake
A	build_files/build_environment/cmake/cuew.cmake
A	build_files/build_environment/cmake/faad.cmake
A	build_files/build_environment/cmake/ffmpeg.cmake
A	build_files/build_environment/cmake/fftw.cmake
A	build_files/build_environment/cmake/flac.cmake
A	build_files/build_environment/cmake/flexbison.cmake
A	build_files/build_environment/cmake/freeglut.cmake
A	build_files/build_environment/cmake/freetype.cmake
A	build_files/build_environment/cmake/glew.cmake
A	build_files/build_environment/cmake/glfw.cmake
A	build_files/build_environment/cmake/harvest.cmake
A	build_files/build_environment/cmake/hdf5.cmake
A	build_files/build_environment/cmake/hidapi.cmake
A	build_files/build_environment/cmake/iconv.cmake
A	build_files/build_environment/cmake/ilmbase.cmake
A	build_files/build_environment/cmake/jemalloc.cmake
A	build_files/build_environment/cmake/jpeg.cmake
A	build_files/build_environment/cmake/lame.cmake
A	build_files/build_environment/cmake/lapack.cmake
A	build_files/build_environment/cmake/llvm.cmake
A	build_files/build_environment/cmake/mingw.cmake
A	build_files/build_environment/cmake/numpy.cmake
A	build_files/build_environment/cmake/ogg.cmake
A	build_files/build_environment/cmake/openal.cmake
A	build_files/build_environment/cmake/opencollada.cmake
A	build_files/build_environment/cmake/opencolorio.cmake
A	build_files/build_environment/cmake/openexr.cmake
A	build_files/build_environment/cmake/openimageio.cmake
A	build_files/build_environment/cmake/openjpeg.cmake
A	build_files/build_environment/cmake/opensubdiv.cmake
A	build_files/build_environment/cmake/openvdb.cmake
A	build_files/build_environment/cmake/options.cmake
A	build_files/build_environment/cmake/orc.cmake
A	build_files/build_environment/cmake/osl.cmake
A	build_files/build_environment/cmake/png.cmake
A	build_files/build_environment/cmake/pthreads.cmake
A	build_files/build_environment/cmake/python.cmake
A	build_files/build_environment/cmake/requests.cmake
A	build_files/build_environment/cmake/schroedinger.cmake
A	build_files/build_environment/cmake/sdl.cmake
A	build_files/build_environment/cmake/setup_mingw32.cmake
A	build_files/build_environment/cmake/setup_mingw64.cmake
A	build_files/build_environment/cmake/sndfile.cmake
A	build_files/build_environment/cmake/spnav.cmake
A	build_files/build_environment/cmake/tbb.cmake
A	build_files/build_environment/cmake/theora.cmake
A	build_files/build_environment/cmake/tiff.cmake
A	build_files/build_environment/cmake/versions.cmake
A	build_files/build_environment/cmake/vorbis.cmake
A	build_files/build_environment/cmake/vpx.cmake
A	build_files/build_environment/cmake/webp.cmake
A	build_files/build_environment/cmake/x264.cmake
A	build_files/build_environment/cmake/xml2.cmake
A	build_files/build_environment/cmake/xvidcore.cmake
A	build_files/build_environment/cmake/zlib.cmake
A	build_files/build_environment/cmake/zlib_mingw.cmake
M	build_files/build_environment/install_deps.sh
A	build_files/build_environment/patches/alembic.diff
A	build_files/build_environment/patches/blosc.diff
A	build_files/build_environment/patches/clang.diff
A	build_files/build_environment/patches/cmake/modules/FindBlosc.cmake
A	build_files/build_environment/patches/cmake/modules/FindCppUnit.cmake
A	build_files/build_environment/patches/cmake/modules/FindIlmBase.cmake
A	build_files/build_environment/patches/cmake/modules/FindLogC4Plus.cmake
A	build_files/build_environment/patches/cmake/modules/FindOpenEXR.cmake
A	build_files/build_environment/patches/cmake/modules/FindTBB.cmake
A	build_files/build_environment/patches/cmake/modules/SelectLibraryConfigurations.cmake
A	build_files/build_environment/patches/cmakelists_glew.txt
A	build_files/build_environment/patches/cmakelists_hidapi.txt
A	build_files/build_environment/patches/cmakelists_openvdb.txt
A	build_files/build_environment/patches/cmakelists_tbb.txt
A	build_files/build_environment/patches/cuew.diff
A	build_files/build_environment/patches/distutildebugflags.diff
A	build_files/build_environment/patches/ffmpeg.diff
A	build_files/build_environment/patches/fftw3.diff
A	build_files/build_environment/patches/hdf5.diff
A	build_files/build_environment/patches/hidapi.diff
R100	build_files/build_environment/install_deps_patches/llvm.patch	build_files/build_environment/patches/install_deps_llvm.diff
R100	build_files/build_environment/install_deps_patches/osl.patch	build_files/build_environment/patches/install_deps_osl.diff
A	build_files/build_environment/patches/libfaad.diff
A	build_files/build_environment/patches/llvm-alloca-fix.diff
A	build_files/build_environment/patches/ming32sh.cmd
A	build_files/build_environment/patches/ming64sh.cmd
A	build_files/build_environment/patches/numpy.diff
A	build_files/build_environment/patches/opencollada.diff
A	build_files/build_environment/patches/opencolorio.diff
A	build_files/build_environment/patches/openexr.diff
A	build_files/build_environment/patches/openimageio_gdi.diff
A	build_files/build_environment/patches/openimageio_idiff.diff
A	build_files/build_environment/patches/openimageio_staticexr.diff
A	build_files/build_environment/patches/opensubdiv.diff
A	build_files/build_environment/patches/openvdb.diff
A	build_files/build_environment/patches/openvdb_vc2013.diff
A	build_files/build_environment/patches/osl.diff
A	build_files/build_environment/patches/osl_simd_oiio.diff
A	build_files/build_environment/patches/pthreads.diff
A	build_files/build_environment/patches/pyshell.diff
A	build_files/build_environment/patches/python.diff
A	build_files/build_environment/patches/python_apple.diff
A	build_files/build_environment/patches/python_runtime_vc2013.diff
A	build_files/build_environment/patches/schroedinger.diff
A	build_files/build_environment/patches/sdl.diff
A	build_files/build_environment/patches/semi.txt
A	build_files/build_environment/windows/build_deps.cmd
A	build_files/build_environment/windows/buildall.cmd
A	build_files/build_environment/windows/nuke.cmd
A	release/windows/blendthumb/CMakeLists.txt
A	release/windows/blendthumb/src/BlendThumb.def
A	release/windows/blendthumb/src/BlendThumb.rc
A	release/windows/blendthumb/src/BlenderThumb.cpp
A	release/windows/blendthumb/src/Dll.cpp

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

diff --git a/.gitignore b/.gitignore
index 3418afebb58..814b7661bc6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -33,3 +33,6 @@ Desktop.ini
 /doc/python_api/sphinx-in/
 /doc/python_api/sphinx-out/
 /doc/python_api/rst/bmesh.ops.rst
+
+# in-source lib downloads
+/build_files/build_environment/downloads
diff --git a/GNUmakefile b/GNUmakefile
index ba7f89c3097..9661f292699 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -43,6 +43,11 @@ ifndef BUILD_DIR
 	BUILD_DIR:=$(shell dirname "$(BLENDER_DIR)")/build_$(OS_NCASE)
 endif
 
+# Dependencies DIR's
+DEPS_SOURCE_DIR:=$(BLENDER_DIR)/build_files/build_environment
+DEPS_BUILD_DIR:=$(BUILD_DIR)/deps
+DEPS_INSTALL_DIR:=$(shell dirname "$(BLENDER_DIR)")/lib/$(OS_NCASE)
+
 # Allow to use alternative binary (pypy3, etc)
 ifndef PYTHON
 	PYTHON:=python3
@@ -146,6 +151,27 @@ cycles: all
 headless: all
 bpy: all
 
+# -----------------------------------------------------------------------------
+# Build dependencies
+DEPS_TARGET = install
+ifneq "$(findstring clean, $(MAKECMDGOALS))" ""
+	DEPS_TARGET = clean
+endif
+
+deps: .FORCE
+	@echo
+	@echo Configuring dependencies in \"$(DEPS_BUILD_DIR)\"
+
+	@cmake -H"$(DEPS_SOURCE_DIR)" \
+	       -B"$(DEPS_BUILD_DIR)" \
+		   -DHARVEST_TARGET=$(DEPS_INSTALL_DIR)
+
+	@echo
+	@echo Building dependencies ...
+	$(MAKE) -C "$(DEPS_BUILD_DIR)" -s -j $(NPROCS) $(DEPS_TARGET)
+	@echo
+	@echo Dependencies successfully built and installed to $(DEPS_INSTALL_DIR).
+	@echo
 
 # -----------------------------------------------------------------------------
 # Configuration (save some cd'ing around)
@@ -164,6 +190,7 @@ help: .FORCE
 	@echo "  * headless  - build without an interface (renderfarm or server automation)"
 	@echo "  * cycles    - build Cycles standalone only, without Blender"
 	@echo "  * bpy       - build as a python module which can be loaded from python directly"
+	@echo "  * deps      - build library dependencies (intended only for platform maintainers)"
 	@echo ""
 	@echo "  * config    - run cmake configuration tool to set build options"
 	@echo ""
diff --git a/build_files/build_environment/CMakeLists.txt b/build_files/build_environment/CMakeLists.txt
new file mode 100644
index 00000000000..5bcfd477d71
--- /dev/null
+++ b/build_files/build_environment/CMakeLists.txt
@@ -0,0 +1,130 @@
+# ***** 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 *****
+
+####################################################################################################
+#
+# This is a build system used by platform maintainers to build library dependencies on
+# Windows and macOS. There is some support for Linux as well, but not ready for releases.
+#
+# Windows and macOS users should download the precompiled libraries in lib/, Linux users
+# should run install_deps.sh for building dependencies.
+#
+# WINDOWS USAGE:
+#   Don't call this cmake file your self, use build_deps.cmd
+#   build_deps 2013 x64 / build_deps 2013 x86
+#   build_deps 2015 x64 / build_deps 2015 x86
+#
+# MAC OS X USAGE:
+#	Install with homebrew: brew install autoconf automake libtool yasm openssl xz
+#   Run "make deps" from main Blender directory
+#
+# LINUX USAGE:
+#   Install compiler, cmake, autoconf, automake, libtool, yasm
+#   Run "make deps" from main Blender directory
+#
+####################################################################################################
+
+project("BlenderDependencies")
+cmake_minimum_required(VERSION 3.5)
+
+include(ExternalProject)
+include(cmake/options.cmake)
+include(cmake/versions.cmake)
+include(cmake/zlib.cmake)
+include(cmake/blendthumb.cmake)
+include(cmake/openal.cmake)
+include(cmake/png.cmake)
+include(cmake/jpeg.cmake)
+include(cmake/boost.cmake)
+include(cmake/blosc.cmake)
+include(cmake/pthreads.cmake)
+include(cmake/ilmbase.cmake)
+include(cmake/openexr.cmake)
+include(cmake/freetype.cmake)
+include(cmake/freeglut.cmake)
+include(cmake/glew.cmake)
+include(cmake/hdf5.cmake)
+include(cmake/alembic.cmake)
+include(cmake/glfw.cmake)
+include(cmake/clew.cmake)
+include(cmake/cuew.cmake)
+include(cmake/opensubdiv.cmake)
+include(cmake/sdl.cmake)
+include(cmake/opencollada.cmake)
+include(cmake/opencolorio.cmake)
+include(cmake/llvm.cmake)
+include(cmake/clang.cmake)
+include(cmake/openimageio.cmake)
+include(cmake/tiff.cmake)
+include(cmake/flexbison.cmake)
+include(cmake/osl.cmake)
+include(cmake/tbb.cmake)
+include(cmake/openvdb.cmake)
+include(cmake/python.cmake)
+include(cmake/requests.cmake)
+include(cmake/numpy.cmake)
+include(cmake/webp.cmake)
+if(WIN32)
+	include(cmake/hidapi.cmake)
+endif()
+
+if(ENABLE_MINGW64)
+	if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
+		include(cmake/setup_mingw64.cmake)
+	else()
+		include(cmake/setup_mingw32.cmake)
+	endif()
+else()
+	set(mingw_LIBDIR ${LIBDIR})
+endif()
+
+if(NOT WIN32 OR ENABLE_MINGW64)
+	if(BUILD_MODE STREQUAL Release)
+		if(WIN32)
+			include(cmake/zlib_mingw.cmake)
+		endif()
+		include(cmake/lame.cmake)
+		include(cmake/ogg.cmake)
+		include(cmake/vorbis.cmake)
+		include(cmake/theora.cmake)
+		include(cmake/vpx.cmake)
+		include(cmake/orc.cmake)
+		include(cmake/schroedinger.cmake)
+		include(cmake/x264.cmake)
+		include(cmake/xvidcore.cmake)
+		include(cmake/openjpeg.cmake)
+		include(cmake/faad.cmake)
+		include(cmake/ffmpeg.cmake)
+		include(cmake/fftw.cmake)
+		include(cmake/sndfile.cmake)
+		if(WIN32)
+			include(cmake/iconv.cmake)
+			include(cmake/lapack.cmake)
+		endif()
+		if(UNIX)
+			include(cmake/flac.cmake)
+			if(NOT APPLE)
+				include(cmake/spnav.cmake)
+				include(cmake/jemalloc.cmake)
+				include(cmake/xml2.cmake)
+			endif()
+		endif()
+	endif()
+endif()
+
+include(cmake/harvest.cmake)
diff --git a/build_files/build_environment/cmake/alembic.cmake b/build_files/build_environment/cmake/alembic.cmake
new file mode 100644
index 00000000000..a49047ec102
--- /dev/null
+++ b/build_files/build_environment/cmake/alembic.cmake
@@ -0,0 +1,75 @@
+# ***** 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 *****
+
+if(ALEMBIC_HDF5)
+	set(ALEMBIC_HDF5_HL)
+	# in debug mode we do not build HDF5_hdf5_hl_LIBRARY which makes cmake really
+	# unhappy, stub it with the debug mode lib. it's not linking it in at this
+	# point in time anyhow
+	if(BUILD_MODE STREQUAL Debug)
+		set(ALEMBIC_HDF5_HL -DHDF5_hdf5_hl_LIBRARY=${LIBDIR}/hdf5/lib/libhdf5_hl_D.${LIBEXT})
+	endif()
+endif()
+
+set(ALEMBIC_EXTRA_ARGS
+	-DBUILDSTATIC=ON
+	-DLINKSTATIC=ON
+	-DALEMBIC_LIB_USES_BOOST=ON
+	-DBoost_COMPILER:STRING=${BOOST_COMPILER_STRING}
+	-DBoost_USE_MULTITHREADED=ON
+	-DUSE_STATIC_BOOST=On
+	-DBoost_USE_STATIC_LIBS=ON
+	-DBoost_USE_STATIC_RUNTIME=ON
+	-DBoost_DEBUG=ON
+	-DBOOST_ROOT=${LIBDIR}/boost
+	-DBoost_NO_SYSTEM_PATHS=ON
+	-DILMBASE_ROOT=${LIBDIR}/ilmbase
+	-DALEMBIC_ILMBASE_INCLUDE_DIRECTORY=${LIBDIR}/ilmbase/include/OpenEXR
+	-DALEMBIC_ILMBASE_HALF_LIB=${LIBDIR}/ilmbase/lib/${LIBPREFIX}Half${LIBEXT}
+	-DALEMBIC_ILMBASE_IMATH_LIB=${LIBDIR}/ilmbase/lib/${LIBPREFIX}Imath-2_2${LIBEXT}
+	-DALEMBIC_ILMBASE_ILMTHREAD_LIB=${LIBDIR}/ilmbase/lib/${LIBPREFIX}IlmThread-2_2${LIBEXT}
+	-DALEMBIC_ILMBASE_IEX_LIB=${LIBDIR}/ilmbase/lib/${LIBPREFIX}Iex-2_2${LIBEXT}
+	-DUSE_PYILMBASE=0
+	-DUSE_PYALEMBIC=0
+	-DUSE_ARNOLD=0
+	-DUSE_MAYA=0
+	-DUSE_PRMAN=0
+	-DUSE_HDF5=Off
+	-DUSE_STATIC_HDF5=Off
+	-DHDF5_ROOT=${LIBDIR}/hdf5
+	-DUSE_TESTS=Off
+	-DALEMBIC_NO_OPENGL=1
+	-DUSE_BINARIES=ON
+	-DALEMBIC_ILMBASE_LINK_STATIC=On
+	-DALEMBIC_SHARED_LIBS=OFF
+	-DGLUT_INCLUDE_DIR=""
+	-DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
+	-DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include/
+	${ALEMBIC_HDF5_HL}
+)
+
+ExternalProject_Add(external_alembic
+	URL ${ALEMBIC_URI}
+	DOWNLOAD_DIR ${DOWNLOAD_DIR}
+	URL_HASH MD5=${ALEMBIC_MD5}
+	PREFIX ${BUILD_DIR}/alembic
+	CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/alembic -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${ALEMBIC_EXTRA_ARGS}
+	INSTALL_DIR ${LIBDIR}/alembic
+)
+
+add_dependencies(external_alembic external_boost external_zlib external_ilmbase)
diff --git a/build_files/build_environment/cmake/blendthumb.cmake b/build_files/build_environment/cmake/blendthumb.cmake
new file mode 100644
index 00000000000..624869971c6
--- /dev/null
+++ b/build_files/build_environment/cmake/blendthumb.cmake
@@ -0,0 +1,61 @@
+# ***** 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 Gen

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list