Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'build_files/build_environment/cmake')
-rw-r--r--build_files/build_environment/cmake/alembic.cmake75
-rw-r--r--build_files/build_environment/cmake/blendthumb.cmake61
-rw-r--r--build_files/build_environment/cmake/blosc.cmake43
-rw-r--r--build_files/build_environment/cmake/boost.cmake107
-rw-r--r--build_files/build_environment/cmake/clang.cmake51
-rw-r--r--build_files/build_environment/cmake/clew.cmake28
-rw-r--r--build_files/build_environment/cmake/cuew.cmake29
-rw-r--r--build_files/build_environment/cmake/faad.cmake35
-rw-r--r--build_files/build_environment/cmake/ffmpeg.cmake119
-rw-r--r--build_files/build_environment/cmake/fftw.cmake40
-rw-r--r--build_files/build_environment/cmake/flac.cmake32
-rw-r--r--build_files/build_environment/cmake/flexbison.cmake31
-rw-r--r--build_files/build_environment/cmake/freeglut.cmake35
-rw-r--r--build_files/build_environment/cmake/freetype.cmake28
-rw-r--r--build_files/build_environment/cmake/glew.cmake32
-rw-r--r--build_files/build_environment/cmake/glfw.cmake28
-rw-r--r--build_files/build_environment/cmake/harvest.cmake279
-rw-r--r--build_files/build_environment/cmake/hdf5.cmake42
-rw-r--r--build_files/build_environment/cmake/hidapi.cmake29
-rw-r--r--build_files/build_environment/cmake/iconv.cmake34
-rw-r--r--build_files/build_environment/cmake/ilmbase.cmake35
-rw-r--r--build_files/build_environment/cmake/jemalloc.cmake28
-rw-r--r--build_files/build_environment/cmake/jpeg.cmake65
-rw-r--r--build_files/build_environment/cmake/lame.cmake47
-rw-r--r--build_files/build_environment/cmake/lapack.cmake43
-rw-r--r--build_files/build_environment/cmake/llvm.cmake61
-rw-r--r--build_files/build_environment/cmake/numpy.cmake57
-rw-r--r--build_files/build_environment/cmake/ogg.cmake32
-rw-r--r--build_files/build_environment/cmake/openal.cmake42
-rw-r--r--build_files/build_environment/cmake/opencollada.cmake37
-rw-r--r--build_files/build_environment/cmake/opencolorio.cmake70
-rw-r--r--build_files/build_environment/cmake/openexr.cmake41
-rw-r--r--build_files/build_environment/cmake/openimageio.cmake132
-rw-r--r--build_files/build_environment/cmake/openjpeg.cmake57
-rw-r--r--build_files/build_environment/cmake/opensubdiv.cmake71
-rw-r--r--build_files/build_environment/cmake/openvdb.cmake71
-rw-r--r--build_files/build_environment/cmake/options.cmake210
-rw-r--r--build_files/build_environment/cmake/orc.cmake32
-rw-r--r--build_files/build_environment/cmake/osl.cmake87
-rw-r--r--build_files/build_environment/cmake/png.cmake41
-rw-r--r--build_files/build_environment/cmake/pthreads.cmake45
-rw-r--r--build_files/build_environment/cmake/python.cmake138
-rw-r--r--build_files/build_environment/cmake/python_site_packages.cmake38
-rw-r--r--build_files/build_environment/cmake/schroedinger.cmake45
-rw-r--r--build_files/build_environment/cmake/sdl.cmake39
-rw-r--r--build_files/build_environment/cmake/setup_mingw32.cmake219
-rw-r--r--build_files/build_environment/cmake/setup_mingw64.cmake219
-rw-r--r--build_files/build_environment/cmake/sndfile.cmake55
-rw-r--r--build_files/build_environment/cmake/spnav.cmake28
-rw-r--r--build_files/build_environment/cmake/tbb.cmake36
-rw-r--r--build_files/build_environment/cmake/theora.cmake40
-rw-r--r--build_files/build_environment/cmake/tiff.cmake44
-rw-r--r--build_files/build_environment/cmake/versions.cmake250
-rw-r--r--build_files/build_environment/cmake/vorbis.cmake38
-rw-r--r--build_files/build_environment/cmake/vpx.cmake60
-rw-r--r--build_files/build_environment/cmake/webp.cmake50
-rw-r--r--build_files/build_environment/cmake/x264.cmake40
-rw-r--r--build_files/build_environment/cmake/xml2.cmake36
-rw-r--r--build_files/build_environment/cmake/xvidcore.cmake44
-rw-r--r--build_files/build_environment/cmake/zlib.cmake33
-rw-r--r--build_files/build_environment/cmake/zlib_mingw.cmake40
61 files changed, 3954 insertions, 0 deletions
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 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(BUILD_MODE STREQUAL Release)
+ if(WIN32)
+ set(THUMB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../release/windows/blendthumb)
+
+ ExternalProject_Add(external_zlib_32
+ URL ${ZLIB_URI}
+ CMAKE_GENERATOR ${GENERATOR_32}
+ URL_HASH MD5=${ZLIB_HASH}
+ DOWNLOAD_DIR ${DOWNLOAD_DIR}
+ PREFIX ${BUILD_DIR}/zlib32
+ CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/zlib32 ${DEFAULT_CMAKE_FLAGS}
+ INSTALL_DIR ${LIBDIR}/zlib32
+ )
+
+ ExternalProject_Add(external_zlib_64
+ URL ${ZLIB_URI}
+ CMAKE_GENERATOR ${GENERATOR_64}
+ URL_HASH MD5=${ZLIB_HASH}
+ DOWNLOAD_DIR ${DOWNLOAD_DIR}
+ PREFIX ${BUILD_DIR}/zlib64
+ CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/zlib64 ${DEFAULT_CMAKE_FLAGS}
+ INSTALL_DIR ${LIBDIR}/zlib64
+ )
+
+ ExternalProject_Add(external_blendthumb_32
+ CMAKE_GENERATOR ${GENERATOR_32}
+ SOURCE_DIR ${THUMB_DIR}
+ PREFIX ${BUILD_DIR}/blendthumb32
+ CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/blendThumb32 ${DEFAULT_CMAKE_FLAGS} -DZLIB_INCLUDE=${LIBDIR}/zlib32/include -DZLIB_LIBS=${LIBDIR}/zlib32/lib/zlibstatic.lib
+ INSTALL_DIR ${LIBDIR}/blendthumb32
+ )
+ add_dependencies(external_blendthumb_32 external_zlib_32)
+
+ ExternalProject_Add(external_blendthumb_64
+ CMAKE_GENERATOR ${GENERATOR_64}
+ SOURCE_DIR ${THUMB_DIR}
+ PREFIX ${BUILD_DIR}/blendthumb64
+ CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/blendThumb64 ${DEFAULT_CMAKE_FLAGS} -DZLIB_INCLUDE=${LIBDIR}/zlib64/include -DZLIB_LIBS=${LIBDIR}/zlib64/lib/zlibstatic.lib
+ INSTALL_DIR ${LIBDIR}/blendthumb64
+ )
+ add_dependencies(external_blendthumb_64 external_zlib_64)
+ endif()
+endif()
diff --git a/build_files/build_environment/cmake/blosc.cmake b/build_files/build_environment/cmake/blosc.cmake
new file mode 100644
index 00000000000..68df525b802
--- /dev/null
+++ b/build_files/build_environment/cmake/blosc.cmake
@@ -0,0 +1,43 @@
+# ***** 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(BLOSC_EXTRA_ARGS
+ -DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include/
+ -DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
+ -DBUILD_TESTS=OFF
+ -DBUILD_BENCHMARKS=OFF
+ -DCMAKE_DEBUG_POSTFIX=_d
+ -DThreads_FOUND=1
+ -DPTHREAD_LIBS=${LIBDIR}/pthreads/lib/pthreadVC2.lib
+ -DPTHREAD_INCLUDE_DIR=${LIBDIR}/pthreads/inc
+)
+
+ExternalProject_Add(external_blosc
+ URL ${BLOSC_URI}
+ DOWNLOAD_DIR ${DOWNLOAD_DIR}
+ URL_HASH MD5=${BLOSC_HASH}
+ PREFIX ${BUILD_DIR}/blosc
+ PATCH_COMMAND ${PATCH_CMD} --verbose -p 1 -N -d ${BUILD_DIR}/blosc/src/external_blosc < ${PATCH_DIR}/blosc.diff
+ CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/blosc ${DEFAULT_CMAKE_FLAGS} ${BLOSC_EXTRA_ARGS}
+ INSTALL_DIR ${LIBDIR}/blosc
+)
+
+add_dependencies(external_blosc external_zlib)
+if(WIN32)
+ add_dependencies(external_blosc external_pthreads)
+endif()
diff --git a/build_files/build_environment/cmake/boost.cmake b/build_files/build_environment/cmake/boost.cmake
new file mode 100644
index 00000000000..d98df30a38f
--- /dev/null
+++ b/build_files/build_environment/cmake/boost.cmake
@@ -0,0 +1,107 @@
+# ***** 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(WIN32)
+ if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
+ set(PYTHON_ARCH x64)
+ set(PYTHON_ARCH2 win-AMD64)
+ set(PYTHON_OUTPUTDIR ${BUILD_DIR}/python/src/external_python/pcbuild/amd64/)
+ else()
+ set(PYTHON_ARCH x86)
+ set(PYTHON_ARCH2 win32)
+ set(PYTHON_OUTPUTDIR ${BUILD_DIR}/python/src/external_python/pcbuild/win32/)
+ endif()
+ if(MSVC12)
+ set(BOOST_TOOLSET toolset=msvc-12.0)
+ set(BOOST_COMPILER_STRING -vc120)
+ set(PYTHON_COMPILER_STRING v120)
+ endif()
+ if(MSVC14)
+ set(BOOST_TOOLSET toolset=msvc-14.0)
+ set(BOOST_COMPILER_STRING -vc140)
+ set(PYTHON_COMPILER_STRING v140)
+ endif()
+ set(JAM_FILE ${BUILD_DIR}/boost/src/external_boost/user-config.jam)
+ set(semi_path "${PATCH_DIR}/semi.txt")
+ FILE(TO_NATIVE_PATH ${semi_path} semi_path)
+ set(BOOST_CONFIGURE_COMMAND bootstrap.bat &&
+ echo using python : ${PYTHON_OUTPUTDIR}\\python.exe > "${JAM_FILE}" &&
+ echo. : ${BUILD_DIR}/python/src/external_python/include ${BUILD_DIR}/python/src/external_python/pc >> "${JAM_FILE}" &&
+ echo. : ${BUILD_DIR}/python/src/external_python/pcbuild >> "${JAM_FILE}" &&
+ type ${semi_path} >> "${JAM_FILE}"
+ )
+ set(BOOST_BUILD_COMMAND bjam)
+ #--user-config=user-config.jam
+ set(BOOST_BUILD_OPTIONS runtime-link=static )
+ #set(BOOST_WITH_PYTHON --with-python)
+ set(BOOST_HARVEST_CMD ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/boost/lib/ ${HARVEST_TARGET}/boost/lib/ )
+ if(BUILD_MODE STREQUAL Release)
+ set(BOOST_HARVEST_CMD ${BOOST_HARVEST_CMD} && ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/boost/include/boost-1_60/ ${HARVEST_TARGET}/boost/include/)
+ endif()
+
+elseif(APPLE)
+ set(BOOST_CONFIGURE_COMMAND ./bootstrap.sh)
+ set(BOOST_BUILD_COMMAND ./bjam)
+ set(BOOST_BUILD_OPTIONS toolset=clang cxxflags=${PLATFORM_CXXFLAGS} linkflags=${PLATFORM_LDFLAGS} --disable-icu boost.locale.icu=off)
+ set(BOOST_HARVEST_CMD echo .)
+else()
+ set(BOOST_HARVEST_CMD echo .)
+ set(BOOST_CONFIGURE_COMMAND ./bootstrap.sh)
+ set(BOOST_BUILD_COMMAND ./bjam)
+ set(BOOST_BUILD_OPTIONS cxxflags=${PLATFORM_CXXFLAGS} --disable-icu boost.locale.icu=off)
+endif()
+
+set(BOOST_OPTIONS
+ --with-filesystem
+ --with-locale
+ --with-thread
+ --with-regex
+ --with-system
+ --with-date_time
+ --with-wave
+ --with-atomic
+ --with-serialization
+ --with-program_options
+ --with-iostreams
+ ${BOOST_WITH_PYTHON}
+ ${BOOST_TOOLSET}
+)
+
+if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
+ set(BOOST_ADDRESS_MODEL 64)
+else()
+ set(BOOST_ADDRESS_MODEL 32)
+endif()
+
+string(TOLOWER ${BUILD_MODE} BOOST_BUILD_TYPE)
+
+ExternalProject_Add(external_boost
+ URL ${BOOST_URI}
+ DOWNLOAD_DIR ${DOWNLOAD_DIR}
+ URL_HASH MD5=${BOOST_MD5}
+ PREFIX ${BUILD_DIR}/boost
+ UPDATE_COMMAND ""
+ CONFIGURE_COMMAND ${BOOST_CONFIGURE_COMMAND}
+ BUILD_COMMAND ${BOOST_BUILD_COMMAND} ${BOOST_BUILD_OPTIONS} -j${MAKE_THREADS} architecture=x86 address-model=${BOOST_ADDRESS_MODEL} variant=${BOOST_BUILD_TYPE} link=static threading=multi ${BOOST_OPTIONS} --prefix=${LIBDIR}/boost install
+ BUILD_IN_SOURCE 1
+ INSTALL_COMMAND "${BOOST_HARVEST_CMD}"
+)
+
+if(WIN32)
+ add_dependencies(external_boost Make_Python_Environment)
+endif()
diff --git a/build_files/build_environment/cmake/clang.cmake b/build_files/build_environment/cmake/clang.cmake
new file mode 100644
index 00000000000..2c7f271b5fc
--- /dev/null
+++ b/build_files/build_environment/cmake/clang.cmake
@@ -0,0 +1,51 @@
+# ***** 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(CLANG_EXTRA_ARGS
+ -DCLANG_PATH_TO_LLVM_SOURCE=${BUILD_DIR}/ll/src/ll
+ -DCLANG_PATH_TO_LLVM_BUILD=${LIBDIR}/llvm
+ -DLLVM_USE_CRT_RELEASE=MT
+ -DLLVM_USE_CRT_DEBUG=MTd
+)
+ExternalProject_Add(external_clang
+ URL ${CLANG_URI}
+ DOWNLOAD_DIR ${DOWNLOAD_DIR}
+ URL_HASH MD5=${CLANG_HASH}
+ PATCH_COMMAND ${PATCH_CMD} -p 2 -N -R -d ${BUILD_DIR}/clang/src/external_clang < ${PATCH_DIR}/clang.diff
+ PREFIX ${BUILD_DIR}/clang
+ CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/clang ${DEFAULT_CMAKE_FLAGS} ${CLANG_EXTRA_ARGS}
+ INSTALL_DIR ${LIBDIR}/clang
+)
+
+if (MSVC)
+ if (BUILD_MODE STREQUAL Release)
+ set(CLANG_HARVEST_COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/clang/ ${HARVEST_TARGET}/llvm/ )
+ else()
+ set(CLANG_HARVEST_COMMAND
+ ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/clang/lib/ ${HARVEST_TARGET}/llvm/debug/lib/ &&
+ ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/clang/bin/ ${HARVEST_TARGET}/llvm/debug/bin/ &&
+ ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/clang/include/ ${HARVEST_TARGET}/llvm/debug/include/
+ )
+ endif()
+ ExternalProject_Add_Step(external_clang after_install
+ COMMAND ${CLANG_HARVEST_COMMAND}
+ DEPENDEES mkdir update patch download configure build install
+ )
+endif()
+
+add_dependencies(external_clang ll)
diff --git a/build_files/build_environment/cmake/clew.cmake b/build_files/build_environment/cmake/clew.cmake
new file mode 100644
index 00000000000..0dcc1f24db7
--- /dev/null
+++ b/build_files/build_environment/cmake/clew.cmake
@@ -0,0 +1,28 @@
+# ***** 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(CLEW_EXTRA_ARGS)
+
+ExternalProject_Add(external_clew
+ URL ${CLEW_URI}
+ DOWNLOAD_DIR ${DOWNLOAD_DIR}
+ URL_HASH MD5=${CLEW_HASH}
+ PREFIX ${BUILD_DIR}/clew
+ CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/clew -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${CLEW_EXTRA_ARGS}
+ INSTALL_DIR ${LIBDIR}/clew
+)
diff --git a/build_files/build_environment/cmake/cuew.cmake b/build_files/build_environment/cmake/cuew.cmake
new file mode 100644
index 00000000000..99b7bb5c06d
--- /dev/null
+++ b/build_files/build_environment/cmake/cuew.cmake
@@ -0,0 +1,29 @@
+# ***** 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(CUEW_EXTRA_ARGS)
+
+ExternalProject_Add(external_cuew
+ URL ${CUEW_URI}
+ DOWNLOAD_DIR ${DOWNLOAD_DIR}
+ URL_HASH MD5=${CUEW_HASH}
+ PREFIX ${BUILD_DIR}/cuew
+ PATCH_COMMAND ${PATCH_CMD} --verbose -p 0 -N -d ${BUILD_DIR}/cuew/src/external_cuew < ${PATCH_DIR}/cuew.diff
+ CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/cuew -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${CUEW_EXTRA_ARGS}
+ INSTALL_DIR ${LIBDIR}/cuew
+)
diff --git a/build_files/build_environment/cmake/faad.cmake b/build_files/build_environment/cmake/faad.cmake
new file mode 100644
index 00000000000..3dd90971b84
--- /dev/null
+++ b/build_files/build_environment/cmake/faad.cmake
@@ -0,0 +1,35 @@
+# ***** 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(FAAD_EXTRA_ARGS)
+
+ExternalProject_Add(external_faad
+ URL ${FAAD_URI}
+ DOWNLOAD_DIR ${DOWNLOAD_DIR}
+ URL_HASH MD5=${FAAD_HASH}
+ PREFIX ${BUILD_DIR}/faad
+ PATCH_COMMAND ${PATCH_CMD} --verbose -p 0 -N -d ${BUILD_DIR}/faad/src/external_faad < ${PATCH_DIR}/libfaad.diff
+ CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/faad/src/external_faad/ && ${CONFIGURE_COMMAND} --disable-shared --enable-static --prefix=${LIBDIR}/faad
+ BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/faad/src/external_faad/ && make -j${MAKE_THREADS}
+ INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/faad/src/external_faad/ && make install
+ INSTALL_DIR ${LIBDIR}/faad
+)
+
+if(MSVC)
+ set_target_properties(external_faad PROPERTIES FOLDER Mingw)
+endif()
diff --git a/build_files/build_environment/cmake/ffmpeg.cmake b/build_files/build_environment/cmake/ffmpeg.cmake
new file mode 100644
index 00000000000..2a45849acf5
--- /dev/null
+++ b/build_files/build_environment/cmake/ffmpeg.cmake
@@ -0,0 +1,119 @@
+# ***** 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(FFMPEG_CFLAGS "-I${mingw_LIBDIR}/lame/include -I${mingw_LIBDIR}/openjpeg/include/ -I${mingw_LIBDIR}/ogg/include -I${mingw_LIBDIR}/vorbis/include -I${mingw_LIBDIR}/theora/include -I${mingw_LIBDIR}/vpx/include -I${mingw_LIBDIR}/x264/include -I${mingw_LIBDIR}/xvidcore/include -I${mingw_LIBDIR}/dirac/include/dirac -I${mingw_LIBDIR}/schroedinger/include/schroedinger-1.0 -I${mingw_LIBDIR}/zlib/include")
+set(FFMPEG_LDFLAGS "-L${mingw_LIBDIR}/lame/lib -L${mingw_LIBDIR}/openjpeg/lib -L${mingw_LIBDIR}/ogg/lib -L${mingw_LIBDIR}/vorbis/lib -L${mingw_LIBDIR}/theora/lib -L${mingw_LIBDIR}/vpx/lib -L${mingw_LIBDIR}/x264/lib -L${mingw_LIBDIR}/xvidcore/lib -L${mingw_LIBDIR}/dirac/lib -L${mingw_LIBDIR}/schroedinger/lib -L${mingw_LIBDIR}/orc/lib -L${mingw_LIBDIR}/zlib/lib")
+set(FFMPEG_EXTRA_FLAGS --extra-cflags=${FFMPEG_CFLAGS} --extra-ldflags=${FFMPEG_LDFLAGS})
+set(FFMPEG_ENV PKG_CONFIG_PATH=${mingw_LIBDIR}/schroedinger/lib/pkgconfig:${mingw_LIBDIR}/orc/lib/pkgconfig:${mingw_LIBDIR}/x264/lib/pkgconfig:${mingw_LIBDIR})
+
+if(WIN32)
+ set(FFMPEG_ENV set ${FFMPEG_ENV} &&)
+ set(FFMPEG_EXTRA_FLAGS
+ ${FFMPEG_EXTRA_FLAGS}
+ --disable-static
+ --enable-shared
+ --enable-w32threads
+ --disable-pthreads
+ --enable-libopenjpeg
+ )
+else()
+ set(FFMPEG_EXTRA_FLAGS
+ ${FFMPEG_EXTRA_FLAGS}
+ --enable-static
+ --disable-shared
+ --enable-libopenjpeg)
+endif()
+
+if(APPLE)
+ set(FFMPEG_EXTRA_FLAGS
+ ${FFMPEG_EXTRA_FLAGS}
+ --target-os=darwin
+ )
+endif()
+
+ExternalProject_Add(external_ffmpeg
+ URL ${FFMPEG_URI}
+ DOWNLOAD_DIR ${DOWNLOAD_DIR}
+ URL_HASH MD5=${FFMPEG_HASH}
+ PREFIX ${BUILD_DIR}/ffmpeg
+ CONFIGURE_COMMAND ${CONFIGURE_ENV_NO_PERL} &&
+ cd ${BUILD_DIR}/ffmpeg/src/external_ffmpeg/ &&
+ ${FFMPEG_ENV} ${CONFIGURE_COMMAND_NO_TARGET} ${FFMPEG_EXTRA_FLAGS}
+ --disable-lzma
+ --disable-avfilter
+ --disable-vdpau
+ --disable-bzlib
+ --disable-libgsm
+ --disable-libspeex
+ --enable-libvpx
+ --prefix=${LIBDIR}/ffmpeg
+ --enable-libschroedinger
+ --enable-libtheora
+ --enable-libvorbis
+ --enable-zlib
+ --enable-stripping
+ --enable-runtime-cpudetect
+ --disable-vaapi
+ --disable-nonfree
+ --enable-gpl
+ --disable-postproc
+ --disable-x11grab
+ --enable-libmp3lame
+ --disable-librtmp
+ --enable-libx264
+ --enable-libxvid
+ --disable-libopencore-amrnb
+ --disable-libopencore-amrwb
+ --disable-libdc1394
+ --disable-version3
+ --disable-debug
+ --enable-optimizations
+ --disable-sse
+ --disable-ssse3
+ --enable-ffplay
+ --disable-openssl
+ --disable-securetransport
+ --disable-indev=avfoundation
+ --disable-indev=qtkit
+ --disable-sdl
+ --disable-gnutls
+ --disable-vda
+ --disable-videotoolbox
+ --disable-libxcb
+ --disable-xlib
+ --disable-audiotoolbox
+ --disable-cuvid
+ --disable-nvenc
+ --disable-indev=jack
+ --disable-indev=alsa
+ --disable-outdev=alsa
+ PATCH_COMMAND ${PATCH_CMD} --verbose -p 0 -N -d ${BUILD_DIR}/ffmpeg/src/external_ffmpeg < ${PATCH_DIR}/ffmpeg.diff
+ BUILD_COMMAND ${CONFIGURE_ENV_NO_PERL} && cd ${BUILD_DIR}/ffmpeg/src/external_ffmpeg/ && make -j${MAKE_THREADS}
+ INSTALL_COMMAND ${CONFIGURE_ENV_NO_PERL} && cd ${BUILD_DIR}/ffmpeg/src/external_ffmpeg/ && make install
+ CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/ffmpeg ${DEFAULT_CMAKE_FLAGS}
+ INSTALL_DIR ${LIBDIR}/ffmpeg
+)
+
+if(MSVC)
+ set_target_properties(external_ffmpeg PROPERTIES FOLDER Mingw)
+endif(MSVC)
+
+add_dependencies(external_ffmpeg external_zlib external_faad external_openjpeg external_xvidcore external_x264 external_schroedinger external_vpx external_theora external_vorbis external_ogg external_lame)
+if(WIN32)
+ add_dependencies(external_ffmpeg external_zlib_mingw)
+endif()
diff --git a/build_files/build_environment/cmake/fftw.cmake b/build_files/build_environment/cmake/fftw.cmake
new file mode 100644
index 00000000000..e6e6165199c
--- /dev/null
+++ b/build_files/build_environment/cmake/fftw.cmake
@@ -0,0 +1,40 @@
+# ***** 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(FFTW_EXTRA_ARGS)
+
+if(WIN32)
+ set(FFTW3_ENV set CFLAGS=-fno-stack-check -fno-stack-protector -mno-stack-arg-probe -fno-lto &&)
+ set(FFTW3_PATCH_COMMAND ${PATCH_CMD} --verbose -p 0 -N -d ${BUILD_DIR}/fftw3/src/external_fftw3 < ${PATCH_DIR}/fftw3.diff)
+endif()
+
+ExternalProject_Add(external_fftw3
+ URL ${FFTW_URI}
+ DOWNLOAD_DIR ${DOWNLOAD_DIR}
+ URL_HASH MD5=${FFTW_HASH}
+ PREFIX ${BUILD_DIR}/fftw3
+ CONFIGURE_COMMAND ${CONFIGURE_ENV} && ${FFTW3_ENV} cd ${BUILD_DIR}/fftw3/src/external_fftw3/ && ${CONFIGURE_COMMAND} --enable-static --prefix=${mingw_LIBDIR}/fftw3
+ PATCH_COMMAND ${FFTW3_PATCH_COMMAND}
+ BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/fftw3/src/external_fftw3/ && make -j${MAKE_THREADS}
+ INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/fftw3/src/external_fftw3/ && make install
+ INSTALL_DIR ${LIBDIR}/fftw3
+)
+
+if(MSVC)
+ set_target_properties(external_fftw3 PROPERTIES FOLDER Mingw)
+endif(MSVC)
diff --git a/build_files/build_environment/cmake/flac.cmake b/build_files/build_environment/cmake/flac.cmake
new file mode 100644
index 00000000000..74d222632d0
--- /dev/null
+++ b/build_files/build_environment/cmake/flac.cmake
@@ -0,0 +1,32 @@
+# ***** 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 *****
+
+ExternalProject_Add(external_flac
+ URL ${FLAC_URI}
+ DOWNLOAD_DIR ${DOWNLOAD_DIR}
+ URL_HASH SHA256=${FLAC_HASH}
+ PREFIX ${BUILD_DIR}/flac
+ CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/flac/src/external_flac/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/flac --disable-shared --enable-static
+ BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/flac/src/external_flac/ && make -j${MAKE_THREADS}
+ INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/flac/src/external_flac/ && make install
+ INSTALL_DIR ${LIBDIR}/flac
+)
+
+if(MSVC)
+ set_target_properties(external_flac PROPERTIES FOLDER Mingw)
+endif(MSVC)
diff --git a/build_files/build_environment/cmake/flexbison.cmake b/build_files/build_environment/cmake/flexbison.cmake
new file mode 100644
index 00000000000..f2908e1ce2c
--- /dev/null
+++ b/build_files/build_environment/cmake/flexbison.cmake
@@ -0,0 +1,31 @@
+# ***** 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(FLEXBISON_EXTRA_ARGS)
+
+ExternalProject_Add(external_flexbison
+ URL ${FLEXBISON_URI}
+ DOWNLOAD_DIR ${DOWNLOAD_DIR}
+ URL_HASH MD5=${FLEXBISON_HASH}
+ PREFIX ${BUILD_DIR}/flexbison
+ CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/flexbison ${DEFAULT_CMAKE_FLAGS} ${FLEXBISON_EXTRA_ARGS}
+ CONFIGURE_COMMAND echo .
+ BUILD_COMMAND echo .
+ INSTALL_COMMAND COMMAND ${CMAKE_COMMAND} -E copy_directory ${BUILD_DIR}/flexbison/src/external_flexbison/ ${LIBDIR}/flexbison/
+ INSTALL_DIR ${LIBDIR}/flexbison
+)
diff --git a/build_files/build_environment/cmake/freeglut.cmake b/build_files/build_environment/cmake/freeglut.cmake
new file mode 100644
index 00000000000..043b382e8fd
--- /dev/null
+++ b/build_files/build_environment/cmake/freeglut.cmake
@@ -0,0 +1,35 @@
+# ***** 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(WIN32)
+ if(BUILD_MODE STREQUAL Release)
+ set(FREEGLUT_EXTRA_ARGS
+ -DFREEGLUT_BUILD_SHARED_LIBS=Off
+ -DFREEGLUT_BUILD_STATIC_LIBS=On
+ )
+
+ ExternalProject_Add(external_freeglut
+ URL ${FREEGLUT_URI}
+ DOWNLOAD_DIR ${DOWNLOAD_DIR}
+ URL_HASH MD5=${FREEGLUT_HASH}
+ PREFIX ${BUILD_DIR}/freeglut
+ CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/freeglut ${DEFAULT_C_FLAGS} ${DEFAULT_CXX_FLAGS} ${FREEGLUT_EXTRA_ARGS}
+ INSTALL_DIR ${LIBDIR}/freeglut
+ )
+ endif()
+endif()
diff --git a/build_files/build_environment/cmake/freetype.cmake b/build_files/build_environment/cmake/freetype.cmake
new file mode 100644
index 00000000000..751b2b1f383
--- /dev/null
+++ b/build_files/build_environment/cmake/freetype.cmake
@@ -0,0 +1,28 @@
+# ***** 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(FREETYPE_EXTRA_ARGS -DCMAKE_RELEASE_POSTFIX:STRING=2ST -DCMAKE_DEBUG_POSTFIX:STRING=2ST_d -DWITH_BZip2=OFF -DWITH_HarfBuzz=OFF)
+
+ExternalProject_Add(external_freetype
+ URL ${FREETYPE_URI}
+ DOWNLOAD_DIR ${DOWNLOAD_DIR}
+ URL_HASH MD5=${FREETYPE_HASH}
+ PREFIX ${BUILD_DIR}/freetype
+ CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/freetype ${DEFAULT_CMAKE_FLAGS} ${FREETYPE_EXTRA_ARGS}
+ INSTALL_DIR ${LIBDIR}/freetype
+)
diff --git a/build_files/build_environment/cmake/glew.cmake b/build_files/build_environment/cmake/glew.cmake
new file mode 100644
index 00000000000..b5d9e4d3310
--- /dev/null
+++ b/build_files/build_environment/cmake/glew.cmake
@@ -0,0 +1,32 @@
+# ***** 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(GLEW_EXTRA_ARGS
+ -DBUILD_UTILS=Off
+ -DBUILD_SHARED_LIBS=Off
+)
+
+ExternalProject_Add(external_glew
+ URL ${GLEW_URI}
+ DOWNLOAD_DIR ${DOWNLOAD_DIR}
+ URL_HASH MD5=${GLEW_HASH}
+ PATCH_COMMAND COMMAND ${CMAKE_COMMAND} -E copy ${PATCH_DIR}/cmakelists_glew.txt ${BUILD_DIR}/glew/src/external_glew/CMakeLists.txt
+ PREFIX ${BUILD_DIR}/glew
+ CMAKE_ARGS -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_INSTALL_PREFIX=${LIBDIR}/glew ${DEFAULT_CMAKE_FLAGS} ${GLEW_EXTRA_ARGS}
+ INSTALL_DIR ${LIBDIR}/glew
+)
diff --git a/build_files/build_environment/cmake/glfw.cmake b/build_files/build_environment/cmake/glfw.cmake
new file mode 100644
index 00000000000..ae80080525c
--- /dev/null
+++ b/build_files/build_environment/cmake/glfw.cmake
@@ -0,0 +1,28 @@
+# ***** 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(GLFW_EXTRA_ARGS)
+
+ExternalProject_Add(external_glfw
+ URL ${GLFW_URI}
+ DOWNLOAD_DIR ${DOWNLOAD_DIR}
+ URL_HASH MD5=${GLFW_HASH}
+ PREFIX ${BUILD_DIR}/glfw
+ CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/glfw -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${GLFW_EXTRA_ARGS}
+ INSTALL_DIR ${LIBDIR}/glfw
+)
diff --git a/build_files/build_environment/cmake/harvest.cmake b/build_files/build_environment/cmake/harvest.cmake
new file mode 100644
index 00000000000..a430c4b33bf
--- /dev/null
+++ b/build_files/build_environment/cmake/harvest.cmake
@@ -0,0 +1,279 @@
+# ***** 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 *****
+
+########################################################################
+# Copy all generated files to the proper strucure as blender prefers
+########################################################################
+
+if(NOT DEFINED HARVEST_TARGET)
+ set(HARVEST_TARGET ${CMAKE_CURRENT_SOURCE_DIR}/Harvest)
+endif()
+message("HARVEST_TARGET = ${HARVEST_TARGET}")
+
+if(WIN32)
+
+if(BUILD_MODE STREQUAL Release)
+ add_custom_target(Harvest_Release_Results
+ # Zlib Rename the lib file and copy the include/bin folders
+ COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/zlib/lib/zlibstatic.lib ${HARVEST_TARGET}/zlib/lib/libz_st.lib &&
+ ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/zlib/include/ ${HARVEST_TARGET}/zlib/include/ &&
+ ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/zlib/bin/ ${HARVEST_TARGET}/zlib/bin/ &&
+ # jpeg rename libfile + copy include
+ ${CMAKE_COMMAND} -E copy ${LIBDIR}/jpg/lib/jpeg-static.lib ${HARVEST_TARGET}/jpeg/lib/libjpeg.lib &&
+ ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/jpg/include/ ${HARVEST_TARGET}/jpeg/include/ &&
+ # FreeType, straight up copy
+ ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/freetype ${HARVEST_TARGET}/freetype &&
+ # pthreads, rename include dir
+ ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/pthreads/inc/ ${HARVEST_TARGET}/pthreads/include/ &&
+ ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/pthreads/lib/ ${HARVEST_TARGET}/pthreads/lib &&
+ # ffmpeg copy include+bin
+ ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/ffmpeg/include ${HARVEST_TARGET}/ffmpeg/include &&
+ ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/ffmpeg/bin ${HARVEST_TARGET}/ffmpeg/lib &&
+ # sdl merge bin/lib folder, copy include
+ ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/sdl/include/sdl2 ${HARVEST_TARGET}/sdl/include &&
+ ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/sdl/lib ${HARVEST_TARGET}/sdl/lib &&
+ ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/sdl/bin ${HARVEST_TARGET}/sdl/lib &&
+ # openal
+ ${CMAKE_COMMAND} -E copy ${LIBDIR}/openal/lib/openal32.lib ${HARVEST_TARGET}/openal/lib/openal32.lib &&
+ ${CMAKE_COMMAND} -E copy ${LIBDIR}/openal/bin/openal32.dll ${HARVEST_TARGET}/openal/lib/openal32.dll &&
+ ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openal/include/ ${HARVEST_TARGET}/openal/include/ &&
+ # OpenImageIO
+ ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/OpenImageIO/include ${HARVEST_TARGET}/OpenImageIO/include &&
+ ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/OpenImageIO/lib ${HARVEST_TARGET}/OpenImageIO/lib &&
+ ${CMAKE_COMMAND} -E copy ${LIBDIR}/OpenImageIO/bin/idiff.exe ${HARVEST_TARGET}/OpenImageIO/bin/idiff.exe &&
+ # openEXR
+ ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/ilmbase ${HARVEST_TARGET}/openexr &&
+ ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openexr/lib ${HARVEST_TARGET}/openexr/lib &&
+ ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openexr/include ${HARVEST_TARGET}/openexr/include &&
+ # png
+ ${CMAKE_COMMAND} -E copy ${LIBDIR}/png/lib/libpng16_static.lib ${HARVEST_TARGET}/png/lib/libpng.lib &&
+ ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/png/include/ ${HARVEST_TARGET}/png/include/ &&
+ # fftw3
+ ${CMAKE_COMMAND} -E copy ${LIBDIR}/fftw3/lib/libfftw3.a ${HARVEST_TARGET}/fftw3/lib/libfftw.lib &&
+ ${CMAKE_COMMAND} -E copy ${LIBDIR}/fftw3/include/fftw3.h ${HARVEST_TARGET}/fftw3/include/fftw3.h &&
+ # freeglut-> opengl
+ ${CMAKE_COMMAND} -E copy ${LIBDIR}/freeglut/lib/freeglut_static.lib ${HARVEST_TARGET}/opengl/lib/freeglut_static.lib &&
+ ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/freeglut/include/ ${HARVEST_TARGET}/opengl/include/ &&
+ # glew-> opengl
+ ${CMAKE_COMMAND} -E copy ${LIBDIR}/glew/lib/libglew32.lib ${HARVEST_TARGET}/opengl/lib/glew.lib &&
+ ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/glew/include/ ${HARVEST_TARGET}/opengl/include/ &&
+ # sndfile
+ ${CMAKE_COMMAND} -E copy ${LIBDIR}/sndfile/lib/libsndfile.dll.a ${HARVEST_TARGET}/sndfile/lib/libsndfile-1.lib &&
+ ${CMAKE_COMMAND} -E copy ${LIBDIR}/sndfile/bin/libsndfile-1.dll ${HARVEST_TARGET}/sndfile/lib/libsndfile-1.dll &&
+ ${CMAKE_COMMAND} -E copy ${LIBDIR}/sndfile/include/sndfile.h ${HARVEST_TARGET}/sndfile/include/sndfile.h &&
+ # tiff
+ ${CMAKE_COMMAND} -E copy ${LIBDIR}/tiff/lib/tiff.lib ${HARVEST_TARGET}/tiff/lib/libtiff.lib &&
+ ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/tiff/include/ ${HARVEST_TARGET}/tiff/include/ &&
+ # iconv
+ ${CMAKE_COMMAND} -E copy ${LIBDIR}/iconv/lib/libiconv.a ${HARVEST_TARGET}/iconv/lib/iconv.lib &&
+ ${CMAKE_COMMAND} -E copy ${LIBDIR}/iconv/include/iconv.h ${HARVEST_TARGET}/iconv/include/iconv.h &&
+ # opencolorIO
+ ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/OpenColorIO/ ${HARVEST_TARGET}/opencolorio &&
+ ${CMAKE_COMMAND} -E copy ${LIBDIR}/OpenColorIO/lib/OpenColorIO.dll ${HARVEST_TARGET}/opencolorio/bin/OpenColorIO.dll &&
+ # Osl
+ ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/osl/ ${HARVEST_TARGET}/osl &&
+ # OpenVDB
+ ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openVDB/ ${HARVEST_TARGET}/openVDB &&
+ # blosc
+ ${CMAKE_COMMAND} -E copy ${LIBDIR}/blosc/lib/libblosc.lib ${HARVEST_TARGET}/blosc/lib/libblosc.lib &&
+ ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/blosc/include/ ${HARVEST_TARGET}/blosc/include/ &&
+ # tbb
+ ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb_static.lib ${HARVEST_TARGET}/tbb/lib/tbb.lib &&
+ ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/tbb/include/ ${HARVEST_TARGET}/tbb/include/ &&
+ # opencollada
+ ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/opencollada/ ${HARVEST_TARGET}/opencollada/ &&
+ # opensubdiv
+ ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/opensubdiv ${HARVEST_TARGET}/opensubdiv &&
+ # python
+ ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/python/ ${HARVEST_TARGET}/python/ &&
+ # alembic
+ ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/alembic ${HARVEST_TARGET}/alembic &&
+ # hdf5
+ ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/hdf5 ${HARVEST_TARGET}/hdf5 &&
+ # BlendThumb
+ ${CMAKE_COMMAND} -E copy ${LIBDIR}/BlendThumb64/bin/blendthumb.dll ${HARVEST_TARGET}/ThumbHandler/lib/BlendThumb64.dll &&
+ ${CMAKE_COMMAND} -E copy ${LIBDIR}/BlendThumb32/bin/blendthumb.dll ${HARVEST_TARGET}/ThumbHandler/lib/BlendThumb.dll &&
+ # python
+ ${CMAKE_COMMAND} -E copy ${LIBDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}.tar.gz ${HARVEST_TARGET}/Release/python${PYTHON_SHORT_VERSION_NO_DOTS}.tar.gz &&
+ # numpy
+ ${CMAKE_COMMAND} -E copy ${LIBDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}_numpy_${NUMPY_SHORT_VERSION}.tar.gz ${HARVEST_TARGET}/Release/python${PYTHON_SHORT_VERSION_NO_DOTS}_numpy_${NUMPY_SHORT_VERSION}.tar.gz &&
+ # hidapi
+ ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/hidapi/ ${HARVEST_TARGET}/hidapi/ &&
+ # webp, straight up copy
+ ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/webp ${HARVEST_TARGET}/webp
+ DEPENDS
+)
+endif(BUILD_MODE STREQUAL Release)
+
+if(BUILD_MODE STREQUAL Debug)
+ add_custom_target(Harvest_Debug_Results
+ # OpenImageIO
+ COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openimageio/lib/OpenImageIO.lib ${HARVEST_TARGET}/openimageio/lib/OpenImageIO_d.lib &&
+ ${CMAKE_COMMAND} -E copy ${LIBDIR}/openimageio/lib/OpenImageIO_Util.lib ${HARVEST_TARGET}/openimageio/lib/OpenImageIO_Util_d.lib &&
+ # ilmbase+openexr
+ ${CMAKE_COMMAND} -E copy ${LIBDIR}/ilmbase/lib/Half.lib ${HARVEST_TARGET}/openexr/lib/Half_d.lib &&
+ ${CMAKE_COMMAND} -E copy ${LIBDIR}/ilmbase/lib/Iex-2_2.lib ${HARVEST_TARGET}/openexr/lib/Iex-2_2_d.lib &&
+ ${CMAKE_COMMAND} -E copy ${LIBDIR}/ilmbase/lib/IexMath-2_2.lib ${HARVEST_TARGET}/openexr/lib/IexMath-2_2_d.lib &&
+ ${CMAKE_COMMAND} -E copy ${LIBDIR}/ilmbase/lib/IlmThread-2_2.lib ${HARVEST_TARGET}/openexr/lib/IlmThread-2_2_d.lib &&
+ ${CMAKE_COMMAND} -E copy ${LIBDIR}/ilmbase/lib/Imath-2_2.lib ${HARVEST_TARGET}/openexr/lib/Imath-2_2_d.lib &&
+ ${CMAKE_COMMAND} -E copy ${LIBDIR}/openexr/lib/IlmImf-2_2.lib ${HARVEST_TARGET}/openexr/lib/IlmImf-2_2_d.lib &&
+ ${CMAKE_COMMAND} -E copy ${LIBDIR}/openexr/lib/IlmImfUtil-2_2.lib ${HARVEST_TARGET}/openexr/lib/IlmImfUtil-2_2_d.lib &&
+ # opencollada
+ ${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/buffer.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/buffer_d.lib &&
+ ${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/ftoa.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/ftoa_d.lib &&
+ ${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/GeneratedSaxParser.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/GeneratedSaxParser_d.lib &&
+ ${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/MathMLSolver.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/MathMLSolver_d.lib &&
+ ${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/OpenCOLLADABaseUtils.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/OpenCOLLADABaseUtils_d.lib &&
+ ${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/OpenCOLLADAFramework.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/OpenCOLLADAFramework_d.lib &&
+ ${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/OpenCOLLADASaxFrameworkLoader.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/OpenCOLLADASaxFrameworkLoader_d.lib &&
+ ${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/OpenCOLLADAStreamWriter.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/OpenCOLLADAStreamWriter_d.lib &&
+ ${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/pcre.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/pcre_d.lib &&
+ ${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/UTF.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/UTF_d.lib &&
+ ${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/xml.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/xml_d.lib &&
+ # blosc
+ ${CMAKE_COMMAND} -E copy ${LIBDIR}/blosc/lib/libblosc_d.lib ${HARVEST_TARGET}/blosc/lib/libblosc_d.lib &&
+ # osl
+ ${CMAKE_COMMAND} -E copy ${LIBDIR}/osl/lib/oslcomp.lib ${HARVEST_TARGET}/osl/lib/oslcomp_d.lib &&
+ ${CMAKE_COMMAND} -E copy ${LIBDIR}/osl/lib/oslexec.lib ${HARVEST_TARGET}/osl/lib/oslexec_d.lib &&
+ ${CMAKE_COMMAND} -E copy ${LIBDIR}/osl/lib/oslquery.lib ${HARVEST_TARGET}/osl/lib/oslquery_d.lib &&
+ # opensubdiv
+ ${CMAKE_COMMAND} -E copy ${LIBDIR}/opensubdiv/lib/osdCPU.lib ${HARVEST_TARGET}/opensubdiv/lib/osdCPU_d.lib &&
+ ${CMAKE_COMMAND} -E copy ${LIBDIR}/opensubdiv/lib/osdGPU.lib ${HARVEST_TARGET}/opensubdiv/lib/osdGPU_d.lib &&
+ # tbb
+ ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb_static.lib ${HARVEST_TARGET}/tbb/lib/tbb_debug.lib &&
+ # openvdb
+ ${CMAKE_COMMAND} -E copy ${LIBDIR}/openvdb/lib/openvdb.lib ${HARVEST_TARGET}/openvdb/lib/openvdb_d.lib &&
+ # python
+ ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/python/ ${HARVEST_TARGET}/python/ &&
+ # alembic
+ ${CMAKE_COMMAND} -E copy ${LIBDIR}/alembic/lib/alembic.lib ${HARVEST_TARGET}/alembic/lib/alembic_d.lib &&
+ # hdf5
+ ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/hdf5/lib ${HARVEST_TARGET}/hdf5/lib &&
+ # numpy
+ ${CMAKE_COMMAND} -E copy ${LIBDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}_numpy_${NUMPY_SHORT_VERSION}d.tar.gz ${HARVEST_TARGET}/Release/python${PYTHON_SHORT_VERSION_NO_DOTS}_numpy_${NUMPY_SHORT_VERSION}d.tar.gz &&
+ # python
+ ${CMAKE_COMMAND} -E copy ${LIBDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}_d.tar.gz ${HARVEST_TARGET}/Release/python${PYTHON_SHORT_VERSION_NO_DOTS}_d.tar.gz
+ DEPENDS Package_Python
+)
+endif(BUILD_MODE STREQUAL Debug)
+
+else(WIN32)
+
+function(harvest from to)
+ set(pattern "")
+ foreach(f ${ARGN})
+ set(pattern ${f})
+ endforeach()
+
+ if(pattern STREQUAL "")
+ get_filename_component(dirpath ${to} DIRECTORY)
+ get_filename_component(filename ${to} NAME)
+ install(
+ FILES ${LIBDIR}/${from}
+ DESTINATION ${HARVEST_TARGET}/${dirpath}
+ RENAME ${filename})
+ else()
+ install(
+ DIRECTORY ${LIBDIR}/${from}/
+ DESTINATION ${HARVEST_TARGET}/${to}
+ USE_SOURCE_PERMISSIONS
+ FILES_MATCHING PATTERN ${pattern}
+ PATTERN "pkgconfig" EXCLUDE
+ PATTERN "cmake" EXCLUDE
+ PATTERN "clang" EXCLUDE
+ PATTERN "__pycache__" EXCLUDE
+ PATTERN "tests" EXCLUDE)
+ endif()
+endfunction()
+
+harvest(alembic/include alembic/include "*.h")
+harvest(alembic/lib/libAlembic.a alembic/lib/libAlembic.a)
+harvest(alembic/bin alembic/bin "*")
+harvest(blosc/lib openvdb/lib "*.a")
+harvest(boost/include boost/include "*")
+harvest(boost/lib boost/lib "*.a")
+harvest(ffmpeg/include ffmpeg/include "*.h")
+harvest(ffmpeg/lib ffmpeg/lib "*.a")
+harvest(fftw3/include fftw3/include "*.h")
+harvest(fftw3/lib fftw3/lib "*.a")
+harvest(flac/lib sndfile/lib "libFLAC.a")
+harvest(freetype/include freetype/include "*.h")
+harvest(freetype/lib/libfreetype2ST.a freetype/lib/libfreetype.a)
+harvest(glew/include glew/include "*.h")
+harvest(glew/lib glew/lib "*.a")
+harvest(ilmbase openexr "*")
+harvest(ilmbase/include openexr/include "*.h")
+harvest(jemalloc/include jemalloc/include "*.h")
+harvest(jemalloc/lib jemalloc/lib "*.a")
+harvest(jpg/include jpeg/include "*.h")
+harvest(jpg/lib jpeg/lib "libjpeg.a")
+harvest(lame/lib ffmpeg/lib "*.a")
+harvest(llvm/bin llvm/bin "llvm-config")
+harvest(llvm/lib llvm/lib "libLLVM*.a")
+harvest(ogg/lib ffmpeg/lib "*.a")
+harvest(openal/include openal/include "*.h")
+if(UNIX AND NOT APPLE)
+ harvest(openal/lib openal/lib "*.a")
+endif()
+harvest(opencollada/include/opencollada opencollada/include "*.h")
+harvest(opencollada/lib/opencollada opencollada/lib "*.a")
+harvest(opencolorio/include opencolorio/include "*.h")
+harvest(opencolorio/lib opencolorio/lib "*.a")
+harvest(openexr/include openexr/include "*.h")
+harvest(openexr/lib openexr/lib "*.a")
+harvest(openimageio/bin openimageio/bin "idiff")
+harvest(openimageio/bin openimageio/bin "maketx")
+harvest(openimageio/bin openimageio/bin "oiiotool")
+harvest(openimageio/include openimageio/include "*")
+harvest(openimageio/lib openimageio/lib "*.a")
+harvest(openjpeg/include/openjpeg-1.5 openjpeg/include "*.h")
+harvest(openjpeg/lib openjpeg/lib "*.a")
+harvest(opensubdiv/include opensubdiv/include "*.h")
+harvest(opensubdiv/lib opensubdiv/lib "*.a")
+harvest(openvdb/include/openvdb/openvdb openvdb/include/openvdb "*.h")
+harvest(openvdb/lib openvdb/lib "*.a")
+harvest(orc/lib/liborc-0.4.a ffmpeg/lib/liborc.a)
+harvest(osl/bin osl/bin "oslc")
+harvest(osl/include osl/include "*.h")
+harvest(osl/lib osl/lib "*.a")
+harvest(osl/shaders osl/shaders "*.h")
+harvest(png/include png/include "*.h")
+harvest(png/lib png/lib "*.a")
+harvest(python/bin python/bin "python${PYTHON_SHORT_VERSION}m")
+harvest(python/include python/include "*h")
+harvest(python/lib python/lib "*")
+harvest(schroedinger/lib/libschroedinger-1.0.a ffmpeg/lib/libschroedinger.a)
+harvest(sdl/include/SDL2 sdl/include "*.h")
+harvest(sdl/lib sdl/lib "libSDL2.a")
+harvest(sndfile/include sndfile/include "*.h")
+harvest(sndfile/lib sndfile/lib "*.a")
+harvest(spnav/include spnav/include "*.h")
+harvest(spnav/lib spnav/lib "*.a")
+harvest(tbb/include tbb/include "*.h")
+harvest(tbb/lib/libtbb_static.a tbb/lib/libtbb.a)
+harvest(theora/lib ffmpeg/lib "*.a")
+harvest(tiff/include tiff/include "*.h")
+harvest(tiff/lib tiff/lib "*.a")
+harvest(vorbis/lib ffmpeg/lib "*.a")
+harvest(vpx/lib ffmpeg/lib "*.a")
+harvest(webp/lib ffmpeg/lib "*.a")
+harvest(x264/lib ffmpeg/lib "*.a")
+harvest(xml2/lib opencollada/lib "*.a")
+harvest(xvidcore/lib ffmpeg/lib "*.a")
+
+endif(WIN32)
diff --git a/build_files/build_environment/cmake/hdf5.cmake b/build_files/build_environment/cmake/hdf5.cmake
new file mode 100644
index 00000000000..09d40d0605f
--- /dev/null
+++ b/build_files/build_environment/cmake/hdf5.cmake
@@ -0,0 +1,42 @@
+# ***** 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(HDF5_EXTRA_ARGS
+ -DHDF5_ENABLE_THREADSAFE=Off
+ -DHDF5_BUILD_CPP_LIB=Off
+ -DBUILD_TESTING=Off
+ -DHDF5_BUILD_TOOLS=Off
+ -DHDF5_BUILD_EXAMPLES=Off
+ -DHDF5_BUILD_HL_LIB=On
+ -DBUILD_STATIC_CRT_LIBS=On
+ -DBUILD_SHARED_LIBS=On
+)
+
+if(WIN32)
+ set(HDF5_PATCH ${PATCH_CMD} --verbose -p 0 -d ${BUILD_DIR}/hdf5/src/external_hdf5 < ${PATCH_DIR}/hdf5.diff)
+endif()
+
+ExternalProject_Add(external_hdf5
+ URL ${HDF5_URI}
+ DOWNLOAD_DIR ${DOWNLOAD_DIR}
+ URL_HASH MD5=${HDF5_HASH}
+ PREFIX ${BUILD_DIR}/hdf5
+ PATCH_COMMAND ${HDF5_PATCH}
+ CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/hdf5 ${HDF5_EXTRA_ARGS}
+ INSTALL_DIR ${LIBDIR}/hdf5
+)
diff --git a/build_files/build_environment/cmake/hidapi.cmake b/build_files/build_environment/cmake/hidapi.cmake
new file mode 100644
index 00000000000..cfa4cc53d2d
--- /dev/null
+++ b/build_files/build_environment/cmake/hidapi.cmake
@@ -0,0 +1,29 @@
+# ***** 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(HIDAPI_EXTRA_ARGS)
+
+ExternalProject_Add(external_hidapi
+ URL ${HIDAPI_URI}
+ DOWNLOAD_DIR ${DOWNLOAD_DIR}
+ URL_HASH MD5=${HIDAPI_HASH}
+ PREFIX ${BUILD_DIR}/hidapi
+ PATCH_COMMAND COMMAND ${CMAKE_COMMAND} -E copy ${PATCH_DIR}/cmakelists_hidapi.txt ${BUILD_DIR}/hidapi/src/external_hidapi/cmakelists.txt && ${PATCH_CMD} -p 0 -d ${BUILD_DIR}/hidapi/src/external_hidapi < ${PATCH_DIR}/hidapi.diff
+ CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/hidapi -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${HIDAPI_EXTRA_ARGS}
+ INSTALL_DIR ${LIBDIR}/hidapi
+)
diff --git a/build_files/build_environment/cmake/iconv.cmake b/build_files/build_environment/cmake/iconv.cmake
new file mode 100644
index 00000000000..cd6cf9547df
--- /dev/null
+++ b/build_files/build_environment/cmake/iconv.cmake
@@ -0,0 +1,34 @@
+# ***** 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(ICONV_EXTRA_ARGS)
+
+ExternalProject_Add(external_iconv
+ URL ${ICONV_URI}
+ DOWNLOAD_DIR ${DOWNLOAD_DIR}
+ URL_HASH MD5=${ICONV_HASH}
+ PREFIX ${BUILD_DIR}/iconv
+ CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/iconv/src/external_iconv/ && ${CONFIGURE_COMMAND} --enable-static --prefix=${mingw_LIBDIR}/iconv
+ BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/iconv/src/external_iconv/ && make -j${MAKE_THREADS}
+ INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/iconv/src/external_iconv/ && make install
+ INSTALL_DIR ${LIBDIR}/iconv
+)
+
+if(MSVC)
+ set_target_properties(external_iconv PROPERTIES FOLDER Mingw)
+endif()
diff --git a/build_files/build_environment/cmake/ilmbase.cmake b/build_files/build_environment/cmake/ilmbase.cmake
new file mode 100644
index 00000000000..0639848346f
--- /dev/null
+++ b/build_files/build_environment/cmake/ilmbase.cmake
@@ -0,0 +1,35 @@
+# ***** 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(WIN32)
+ set(ILMBASE_CMAKE_CXX_STANDARD_LIBRARIES "kernel32${LIBEXT} user32${LIBEXT} gdi32${LIBEXT} winspool${LIBEXT} shell32${LIBEXT} ole32${LIBEXT} oleaut32${LIBEXT} uuid${LIBEXT} comdlg32${LIBEXT} advapi32${LIBEXT} psapi${LIBEXT}")
+endif()
+
+set(ILMBASE_EXTRA_ARGS
+ -DBUILD_SHARED_LIBS=OFF
+ -DCMAKE_CXX_STANDARD_LIBRARIES=${ILMBASE_CMAKE_CXX_STANDARD_LIBRARIES}
+)
+
+ExternalProject_Add(external_ilmbase
+ URL ${ILMBASE_URI}
+ DOWNLOAD_DIR ${DOWNLOAD_DIR}
+ URL_HASH MD5=${ILMBASE_HASH}
+ PREFIX ${BUILD_DIR}/ilmbase
+ CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/ilmbase ${DEFAULT_CMAKE_FLAGS} ${ILMBASE_EXTRA_ARGS}
+ INSTALL_DIR ${LIBDIR}/openexr
+)
diff --git a/build_files/build_environment/cmake/jemalloc.cmake b/build_files/build_environment/cmake/jemalloc.cmake
new file mode 100644
index 00000000000..c39ba448917
--- /dev/null
+++ b/build_files/build_environment/cmake/jemalloc.cmake
@@ -0,0 +1,28 @@
+# ***** 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 *****
+
+ExternalProject_Add(external_jemalloc
+ URL ${JEMALLOC_URI}
+ DOWNLOAD_DIR ${DOWNLOAD_DIR}
+ URL_HASH MD5=${JEMALLOC_HASH}
+ PREFIX ${BUILD_DIR}/jemalloc
+ CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/jemalloc/src/external_jemalloc/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/jemalloc --disable-shared --enable-static --with-pic
+ BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/jemalloc/src/external_jemalloc/ && make -j${MAKE_THREADS}
+ INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/jemalloc/src/external_jemalloc/ && make install
+ INSTALL_DIR ${LIBDIR}/jemalloc
+)
diff --git a/build_files/build_environment/cmake/jpeg.cmake b/build_files/build_environment/cmake/jpeg.cmake
new file mode 100644
index 00000000000..1f2b04387f0
--- /dev/null
+++ b/build_files/build_environment/cmake/jpeg.cmake
@@ -0,0 +1,65 @@
+# ***** 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(WIN32)
+ # cmake for windows
+ set(JPEG_EXTRA_ARGS -DWITH_JPEG8=ON -DCMAKE_DEBUG_POSTFIX=d)
+
+ ExternalProject_Add(external_jpeg
+ URL ${JPEG_URI}
+ DOWNLOAD_DIR ${DOWNLOAD_DIR}
+ URL_HASH MD5=${JPEG_HASH}
+ PREFIX ${BUILD_DIR}/jpg
+ CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/jpg ${DEFAULT_CMAKE_FLAGS} ${JPEG_EXTRA_ARGS}
+ INSTALL_DIR ${LIBDIR}/jpg
+ )
+
+ if(BUILD_MODE STREQUAL Debug)
+ ExternalProject_Add_Step(external_jpeg after_install
+ COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/jpg/lib/jpegd${LIBEXT} ${LIBDIR}/jpg/lib/jpeg${LIBEXT}
+ DEPENDEES install
+ )
+ endif()
+
+ if(BUILD_MODE STREQUAL Release)
+ set(JPEG_LIBRARY jpeg-static${LIBEXT})
+ else()
+ set(JPEG_LIBRARY jpeg-staticd${LIBEXT})
+ endif()
+else(WIN32)
+ # autoconf for unix
+ if(APPLE)
+ set(JPEG_EXTRA_ARGS --host x86_64-apple-darwin --with-jpeg8)
+ else()
+ set(JPEG_EXTRA_ARGS --with-jpeg8)
+ endif()
+
+ ExternalProject_Add(external_jpeg
+ URL ${JPEG_URI}
+ DOWNLOAD_DIR ${DOWNLOAD_DIR}
+ URL_HASH MD5=${JPEG_HASH}
+ CONFIGURE_COMMAND ${CONFIGURE_ENV} && autoreconf -fiv && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/jpg NASM=yasm ${JPEG_EXTRA_ARGS}
+ BUILD_IN_SOURCE 1
+ BUILD_COMMAND ${CONFIGURE_ENV} && make install
+ PREFIX ${BUILD_DIR}/jpg
+ CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/jpg ${DEFAULT_CMAKE_FLAGS} ${JPEG_EXTRA_ARGS}
+ INSTALL_DIR ${LIBDIR}/jpg
+ )
+
+ set(JPEG_LIBRARY libjpeg${LIBEXT})
+endif(WIN32)
diff --git a/build_files/build_environment/cmake/lame.cmake b/build_files/build_environment/cmake/lame.cmake
new file mode 100644
index 00000000000..a489b2302ce
--- /dev/null
+++ b/build_files/build_environment/cmake/lame.cmake
@@ -0,0 +1,47 @@
+# ***** 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(LAME_EXTRA_ARGS)
+if(MSVC)
+ if("${CMAKE_SIZEOF_VOID_P}" EQUAL "4")
+ set(LAME_EXTRA_ARGS CFLAGS=-msse)
+ endif()
+endif()
+
+ExternalProject_Add(external_lame
+ URL ${LAME_URI}
+ DOWNLOAD_DIR ${DOWNLOAD_DIR}
+ URL_HASH MD5=${LAME_HASH}
+ PREFIX ${BUILD_DIR}/lame
+ CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/lame/src/external_lame/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/lame --disable-shared --enable-static ${LAME_EXTRA_ARGS}
+ --enable-export=full
+ --with-fileio=sndfile
+ --without-vorbis
+ --with-pic
+ --disable-mp3x
+ --disable-mp3rtp
+ --disable-gtktest
+ --enable-export=full
+ BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/lame/src/external_lame/ && make -j${MAKE_THREADS}
+ INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/lame/src/external_lame/ && make install
+ INSTALL_DIR ${LIBDIR}/lame
+)
+
+if(MSVC)
+ set_target_properties(external_lame PROPERTIES FOLDER Mingw)
+endif()
diff --git a/build_files/build_environment/cmake/lapack.cmake b/build_files/build_environment/cmake/lapack.cmake
new file mode 100644
index 00000000000..3110503db52
--- /dev/null
+++ b/build_files/build_environment/cmake/lapack.cmake
@@ -0,0 +1,43 @@
+# ***** 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(LAPACK_EXTRA_ARGS)
+
+if(WIN32)
+ if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
+ set(LAPACK_EXTRA_ARGS -G "MSYS Makefiles" -DCMAKE_Fortran_COMPILER=${DOWNLOAD_DIR}/mingw/mingw64/bin/gfortran.exe)
+ else()
+ set(LAPACK_EXTRA_ARGS -G "MSYS Makefiles" -DCMAKE_Fortran_COMPILER=${DOWNLOAD_DIR}/mingw/mingw32/bin/gfortran.exe)
+ endif()
+endif()
+
+ExternalProject_Add(external_lapack
+ URL ${LAPACK_URI}
+ DOWNLOAD_DIR ${DOWNLOAD_DIR}
+ URL_HASH MD5=${LAPACK_HASH}
+ PREFIX ${BUILD_DIR}/lapack
+ CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/lapack/src/external_lapack/ && ${CMAKE_COMMAND} ${LAPACK_EXTRA_ARGS} -DBUILD_TESTING=Off -DCMAKE_INSTALL_PREFIX=${LIBDIR}/lapack .
+ BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/lapack/src/external_lapack/ && make -j${MAKE_THREADS}
+ INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/lapack/src/external_lapack/ && make install
+
+ INSTALL_DIR ${LIBDIR}/lapack
+)
+
+if(MSVC)
+ set_target_properties(external_lapack PROPERTIES FOLDER Mingw)
+endif()
diff --git a/build_files/build_environment/cmake/llvm.cmake b/build_files/build_environment/cmake/llvm.cmake
new file mode 100644
index 00000000000..f04fe609cb3
--- /dev/null
+++ b/build_files/build_environment/cmake/llvm.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 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(LLVM_EXTRA_ARGS
+ -DLLVM_USE_CRT_RELEASE=MT
+ -DLLVM_USE_CRT_DEBUG=MTd
+ -DLLVM_INCLUDE_TESTS=OFF
+ -DLLVM_TARGETS_TO_BUILD=X86
+ -DLLVM_INCLUDE_EXAMPLES=OFF
+ -DLLVM_ENABLE_TERMINFO=OFF
+)
+
+if(WIN32)
+ set(LLVM_GENERATOR "NMake Makefiles")
+else()
+ set(LLVM_GENERATOR "Unix Makefiles")
+endif()
+
+# short project name due to long filename issues on windows
+ExternalProject_Add(ll
+ URL ${LLVM_URI}
+ DOWNLOAD_DIR ${DOWNLOAD_DIR}
+ URL_HASH MD5=${LLVM_HASH}
+ CMAKE_GENERATOR ${LLVM_GENERATOR}
+ PREFIX ${BUILD_DIR}/ll
+ PATCH_COMMAND ${PATCH_CMD} -p 0 -d ${BUILD_DIR}/ll/src/ll < ${PATCH_DIR}/llvm-alloca-fix.diff
+ CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/llvm ${DEFAULT_CMAKE_FLAGS} ${LLVM_EXTRA_ARGS}
+ INSTALL_DIR ${LIBDIR}/llvm
+)
+
+if (MSVC)
+ if (BUILD_MODE STREQUAL Release)
+ set(LLVM_HARVEST_COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/llvm/ ${HARVEST_TARGET}/llvm/ )
+ else()
+ set(LLVM_HARVEST_COMMAND
+ ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/llvm/lib/ ${HARVEST_TARGET}/llvm/debug/lib/ &&
+ ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/llvm/bin/ ${HARVEST_TARGET}/llvm/debug/bin/ &&
+ ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/llvm/include/ ${HARVEST_TARGET}/llvm/debug/include/
+ )
+ endif()
+ ExternalProject_Add_Step(ll after_install
+ COMMAND ${LLVM_HARVEST_COMMAND}
+ DEPENDEES mkdir update patch download configure build install
+ )
+endif()
+
diff --git a/build_files/build_environment/cmake/numpy.cmake b/build_files/build_environment/cmake/numpy.cmake
new file mode 100644
index 00000000000..107947dabd3
--- /dev/null
+++ b/build_files/build_environment/cmake/numpy.cmake
@@ -0,0 +1,57 @@
+# ***** 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(MSVC)
+ if(BUILD_MODE STREQUAL Debug)
+ set(NUMPY_DIR_POSTFIX -pydebug)
+ set(NUMPY_ARCHIVE_POSTFIX d)
+ set(NUMPY_BUILD_OPTION --debug)
+ else()
+ set(NUMPY_DIR_POSTFIX)
+ set(NUMPY_ARCHIVE_POSTFIX)
+ set(NUMPY_BUILD_OPTION)
+ endif(BUILD_MODE STREQUAL Debug)
+endif()
+
+set(NUMPY_POSTFIX)
+
+if(WIN32)
+ set(NUMPY_INSTALL
+ ${CMAKE_COMMAND} -E copy_directory "${BUILD_DIR}/python/src/external_python/run/lib/site-packages/numpy/core/include/numpy" "${LIBDIR}/python/include/python${PYTHON_SHORT_VERSION}/numpy" &&
+ ${CMAKE_COMMAND} -E chdir "${BUILD_DIR}/numpy/src/external_numpy/build/lib.${PYTHON_ARCH2}-${PYTHON_SHORT_VERSION}${NUMPY_DIR_POSTFIX}"
+ ${CMAKE_COMMAND} -E tar "cfvz" "${LIBDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}_numpy_${NUMPY_SHORT_VERSION}${NUMPY_ARCHIVE_POSTFIX}.tar.gz" "."
+ )
+ set(NUMPY_PATCH ${PATCH_CMD} --verbose -p 1 -N -d ${BUILD_DIR}/numpy/src/external_numpy < ${PATCH_DIR}/numpy.diff )
+else()
+ set(NUMPY_INSTALL echo .)
+ set(NUMPY_PATCH echo .)
+endif()
+
+ExternalProject_Add(external_numpy
+ URL ${NUMPY_URI}
+ DOWNLOAD_DIR ${DOWNLOAD_DIR}
+ URL_HASH MD5=${NUMPY_HASH}
+ PREFIX ${BUILD_DIR}/numpy
+ PATCH_COMMAND ${NUMPY_PATCH}
+ CONFIGURE_COMMAND ""
+ LOG_BUILD 1
+ BUILD_COMMAND ${PYTHON_BINARY} ${BUILD_DIR}/numpy/src/external_numpy/setup.py build ${NUMPY_BUILD_OPTION} install --old-and-unmanageable
+ INSTALL_COMMAND ${NUMPY_INSTALL}
+)
+
+add_dependencies(external_numpy Make_Python_Environment)
diff --git a/build_files/build_environment/cmake/ogg.cmake b/build_files/build_environment/cmake/ogg.cmake
new file mode 100644
index 00000000000..1f69cee0996
--- /dev/null
+++ b/build_files/build_environment/cmake/ogg.cmake
@@ -0,0 +1,32 @@
+# ***** 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 *****
+
+ExternalProject_Add(external_ogg
+ URL ${OGG_URI}
+ DOWNLOAD_DIR ${DOWNLOAD_DIR}
+ URL_HASH SHA256=${OGG_HASH}
+ PREFIX ${BUILD_DIR}/ogg
+ CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/ogg/src/external_ogg/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/ogg --disable-shared --enable-static
+ BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/ogg/src/external_ogg/ && make -j${MAKE_THREADS}
+ INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/ogg/src/external_ogg/ && make install
+ INSTALL_DIR ${LIBDIR}/ogg
+)
+
+if(MSVC)
+ set_target_properties(external_ogg PROPERTIES FOLDER Mingw)
+endif()
diff --git a/build_files/build_environment/cmake/openal.cmake b/build_files/build_environment/cmake/openal.cmake
new file mode 100644
index 00000000000..d63c4443ca0
--- /dev/null
+++ b/build_files/build_environment/cmake/openal.cmake
@@ -0,0 +1,42 @@
+# ***** 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(BUILD_MODE STREQUAL Release)
+ set(OPENAL_EXTRA_ARGS
+ -DALSOFT_UTILS=Off
+ -DALSOFT_NO_CONFIG_UTIL=On
+ -DALSOFT_EXAMPLES=Off
+ -DALSOFT_TESTS=Off
+ -DALSOFT_CONFIG=Off
+ -DALSOFT_HRTF_DEFS=Off
+ -DALSOFT_INSTALL=On
+ )
+
+ if(UNIX)
+ set(OPENAL_EXTRA_ARGS ${OPENAL_EXTRA_ARGS} -DLIBTYPE=STATIC)
+ endif()
+
+ ExternalProject_Add(external_openal
+ URL ${OPENAL_URI}
+ DOWNLOAD_DIR ${DOWNLOAD_DIR}
+ URL_HASH MD5=${OPENAL_HASH}
+ PREFIX ${BUILD_DIR}/openal
+ CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openal ${DEFAULT_CMAKE_FLAGS} ${OPENAL_EXTRA_ARGS}
+ INSTALL_DIR ${LIBDIR}/openal
+ )
+endif()
diff --git a/build_files/build_environment/cmake/opencollada.cmake b/build_files/build_environment/cmake/opencollada.cmake
new file mode 100644
index 00000000000..9b2a2d9dc4d
--- /dev/null
+++ b/build_files/build_environment/cmake/opencollada.cmake
@@ -0,0 +1,37 @@
+# ***** 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(UNIX AND NOT APPLE)
+ set(OPENCOLLADA_EXTRA_ARGS
+ -DLIBXML2_INCLUDE_DIR=${LIBDIR}/xml2/include/libxml2
+ -DLIBXML2_LIBRARIES=${LIBDIR}/xml2/lib/libxml2.a)
+endif()
+
+ExternalProject_Add(external_opencollada
+ URL ${OPENCOLLADA_URI}
+ DOWNLOAD_DIR ${DOWNLOAD_DIR}
+ URL_HASH MD5=${OPENCOLLADA_HASH}
+ PREFIX ${BUILD_DIR}/opencollada
+ PATCH_COMMAND ${PATCH_CMD} -p 1 -N -d ${BUILD_DIR}/opencollada/src/external_opencollada < ${PATCH_DIR}/opencollada.diff
+ CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/opencollada ${DEFAULT_CMAKE_FLAGS} ${OPENCOLLADA_EXTRA_ARGS}
+ INSTALL_DIR ${LIBDIR}/opencollada
+)
+
+if(UNIX AND NOT APPLE)
+ add_dependencies(external_opencollada external_xml2)
+endif()
diff --git a/build_files/build_environment/cmake/opencolorio.cmake b/build_files/build_environment/cmake/opencolorio.cmake
new file mode 100644
index 00000000000..14fb62af672
--- /dev/null
+++ b/build_files/build_environment/cmake/opencolorio.cmake
@@ -0,0 +1,70 @@
+# ***** 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(OPENCOLORIO_EXTRA_ARGS
+ -DBoost_COMPILER:STRING=${BOOST_COMPILER_STRING}
+ -DBoost_USE_MULTITHREADED=ON
+ -DBoost_USE_STATIC_LIBS=ON
+ -DBoost_USE_STATIC_RUNTIME=ON
+ -DBOOST_ROOT=${LIBDIR}/boost
+ -DBOOST_INCLUDEDIR=${LIBDIR}/boost/include/boost_1_60/boost
+ -DBoost_NO_SYSTEM_PATHS=ON
+ -DBoost_DEBUG=ON
+ -DBoost_MAJOR_VERSION=1
+ -DBoost_MINOR_VERSION=60
+ -DOCIO_BUILD_APPS=OFF
+ -DOCIO_BUILD_PYGLUE=OFF
+ -DOCIO_BUILD_NUKE=OFF
+)
+
+if(WIN32)
+ set(OPENCOLORIO_EXTRA_ARGS
+ ${OPENCOLORIO_EXTRA_ARGS}
+ -DOCIO_USE_BOOST_PTR=ON
+ -DOCIO_BUILD_STATIC=OFF
+ -DOCIO_BUILD_SHARED=ON
+ )
+else()
+ set(OPENCOLORIO_EXTRA_ARGS
+ ${OPENCOLORIO_EXTRA_ARGS}
+ -DOCIO_USE_BOOST_PTR=OFF
+ -DOCIO_BUILD_STATIC=ON
+ -DOCIO_BUILD_SHARED=OFF
+ )
+endif()
+
+ExternalProject_Add(external_opencolorio
+ URL ${OPENCOLORIO_URI}
+ DOWNLOAD_DIR ${DOWNLOAD_DIR}
+ URL_HASH MD5=${OPENCOLORIO_HASH}
+ PREFIX ${BUILD_DIR}/opencolorio
+ PATCH_COMMAND ${PATCH_CMD} -p 0 -N -d ${BUILD_DIR}/opencolorio/src/external_opencolorio < ${PATCH_DIR}/opencolorio.diff
+ CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/opencolorio ${DEFAULT_CMAKE_FLAGS} ${OPENCOLORIO_EXTRA_ARGS}
+ INSTALL_DIR ${LIBDIR}/opencolorio
+)
+
+if(NOT WIN32)
+ add_custom_command(
+ OUTPUT ${LIBDIR}/opencolorio/lib/libtinyxml.a
+ COMMAND cp ${BUILD_DIR}/opencolorio/src/external_opencolorio-build/ext/dist/lib/libtinyxml.a ${LIBDIR}/opencolorio/lib/libtinyxml.a
+ COMMAND cp ${BUILD_DIR}/opencolorio/src/external_opencolorio-build/ext/dist/lib/libyaml-cpp.a ${LIBDIR}/opencolorio/lib/libyaml-cpp.a
+ )
+ add_custom_target(external_opencolorio_extra ALL DEPENDS external_opencolorio ${LIBDIR}/opencolorio/lib/libtinyxml.a)
+endif()
+
+add_dependencies(external_opencolorio external_boost)
diff --git a/build_files/build_environment/cmake/openexr.cmake b/build_files/build_environment/cmake/openexr.cmake
new file mode 100644
index 00000000000..53a1bc4c146
--- /dev/null
+++ b/build_files/build_environment/cmake/openexr.cmake
@@ -0,0 +1,41 @@
+# ***** 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(WIN32)
+ set(OPENEXR_CMAKE_CXX_STANDARD_LIBRARIES "kernel32${LIBEXT} user32${LIBEXT} gdi32${LIBEXT} winspool${LIBEXT} shell32${LIBEXT} ole32${LIBEXT} oleaut32${LIBEXT} uuid${LIBEXT} comdlg32${LIBEXT} advapi32${LIBEXT} psapi${LIBEXT}")
+endif()
+
+set(OPENEXR_EXTRA_ARGS
+ -DBUILD_SHARED_LIBS=OFF
+ -DCMAKE_CXX_STANDARD_LIBRARIES=${OPENEXR_CMAKE_CXX_STANDARD_LIBRARIES}
+ -DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
+ -DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include/
+ -DILMBASE_PACKAGE_PREFIX=${LIBDIR}/ilmbase
+)
+
+ExternalProject_Add(external_openexr
+ URL ${OPENEXR_URI}
+ DOWNLOAD_DIR ${DOWNLOAD_DIR}
+ URL_HASH MD5=${OPENEXR_HASH}
+ PREFIX ${BUILD_DIR}/openexr
+ PATCH_COMMAND ${PATCH_CMD} -p 0 -d ${BUILD_DIR}/openexr/src/external_openexr < ${PATCH_DIR}/openexr.diff
+ CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openexr ${DEFAULT_CMAKE_FLAGS} ${OPENEXR_EXTRA_ARGS}
+ INSTALL_DIR ${LIBDIR}/openexr
+)
+
+add_dependencies(external_openexr external_zlib external_ilmbase)
diff --git a/build_files/build_environment/cmake/openimageio.cmake b/build_files/build_environment/cmake/openimageio.cmake
new file mode 100644
index 00000000000..96b221388da
--- /dev/null
+++ b/build_files/build_environment/cmake/openimageio.cmake
@@ -0,0 +1,132 @@
+# ***** 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(BUILD_MODE STREQUAL Release)
+ set(OIIO_TOOLS ON)
+else()
+ set(OIIO_TOOLS OFF)
+endif()
+
+if(UNIX AND NOT APPLE)
+ # This causes linking to static pthread libraries which gives link errors.
+ # Since we manually specify library paths it should static link other libs.
+ set(OPENIMAGEIO_LINKSTATIC -DLINKSTATIC=OFF)
+else()
+ set(OPENIMAGEIO_LINKSTATIC -DLINKSTATIC=ON)
+endif()
+
+if(WIN32)
+ set(PNG_LIBNAME libpng16_static${LIBEXT})
+ set(OIIO_SIMD_FLAGS -DUSE_SIMD=sse2 -DOPJ_STATIC=1)
+ set(OPENJPEG_POSTFIX _msvc)
+else()
+ set(PNG_LIBNAME libpng${LIBEXT})
+ set(OIIO_SIMD_FLAGS)
+endif()
+
+if (WITH_WEBP)
+ set(WEBP_ARGS -DWEBP_INCLUDE_DIR=${LIBDIR}/webp/include
+ -DWEBP_LIBRARY=${LIBDIR}/webp/lib/${LIBPREFIX}webp${LIBEXT} )
+ set(WEBP_DEP external_webp)
+endif()
+
+if (MSVC)
+set(OPENJPEG_FLAGS -DOPENJPEG_HOME=${LIBDIR}/openjpeg_msvc
+ -DOPENJPEG_INCLUDE_DIR=${LIBDIR}/openjpeg_msvc/include/openjpeg-${OPENJPEG_SHORT_VERSION}
+ -DOPENJPEG_LIBRARY=${LIBDIR}/openjpeg_msvc/lib/openjpeg${LIBEXT}
+ -DOPENJPEG_LIBRARY_DEBUG=${LIBDIR}/openjpeg_msvc/lib/openjpeg${LIBEXT}
+ )
+else()
+set(OPENJPEG_FLAGS -DOPENJPEG_INCLUDE_DIR=${LIBDIR}/openjpeg/include/openjpeg-${OPENJPEG_SHORT_VERSION}
+ -DOPENJPEG_LIBRARY=${LIBDIR}/openjpeg/lib/${OPENJPEG_LIBRARY}
+ )
+endif()
+
+set(OPENIMAGEIO_EXTRA_ARGS
+ -DBUILDSTATIC=ON
+ ${OPENIMAGEIO_LINKSTATIC}
+ -DOPENEXR_INCLUDE_DIR=${LIBDIR}/openexr/include/openexr/
+ -DOPENEXR_ILMIMF_LIBRARIES=${LIBDIR}/openexr/lib/IlmImf-2_2${LIBEXT}
+ -DBoost_COMPILER:STRING=${BOOST_COMPILER_STRING}
+ -DBoost_USE_MULTITHREADED=ON
+ -DBoost_USE_STATIC_LIBS=ON
+ -DBoost_USE_STATIC_RUNTIME=ON
+ -DBOOST_ROOT=${LIBDIR}/boost
+ -DBOOST_LIBRARYDIR=${LIBDIR}/boost/lib/
+ -DBoost_NO_SYSTEM_PATHS=ON
+ -OIIO_BUILD_CPP11=ON
+ -DUSE_OPENGL=OFF
+ -DUSE_TBB=OFF
+ -DUSE_FIELD3D=OFF
+ -DUSE_QT=OFF
+ -DUSE_PYTHON=OFF
+ -DUSE_GIF=OFF
+ -DUSE_OPENCV=OFF
+ -DUSE_OPENSSL=OFF
+ -DUSE_OPENJPEG=ON
+ -DUSE_FFMPEG=OFF
+ -DUSE_PTEX=OFF
+ -DUSE_FREETYPE=OFF
+ -DUSE_LIBRAW=OFF
+ -DUSE_PYTHON=OFF
+ -DUSE_PYTHON3=OFF
+ -DUSE_OCIO=OFF
+ -DOIIO_BUILD_TOOLS=${OIIO_TOOLS}
+ -DOIIO_BUILD_TESTS=OFF
+ -DBUILD_TESTING=OFF
+ -DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
+ -DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include
+ -DPNG_LIBRARY=${LIBDIR}/png/lib/${PNG_LIBNAME}
+ -DPNG_PNG_INCLUDE_DIR=${LIBDIR}/png/include
+ -DTIFF_LIBRARY=${LIBDIR}/tiff/lib/${LIBPREFIX}tiff${LIBEXT}
+ -DTIFF_INCLUDE_DIR=${LIBDIR}/tiff/include
+ -DJPEG_LIBRARY=${LIBDIR}/jpg/lib/${JPEG_LIBRARY}
+ -DJPEG_INCLUDE_DIR=${LIBDIR}/jpg/include
+ ${OPENJPEG_FLAGS}
+ -DOCIO_PATH=${LIBDIR}/opencolorio/
+ -DOpenEXR_USE_STATIC_LIBS=On
+ -DOPENEXR_HOME=${LIBDIR}/openexr/
+ -DILMBASE_INCLUDE_PATH=${LIBDIR}/ilmbase/
+ -DILMBASE_PACKAGE_PREFIX=${LIBDIR}/ilmbase/
+ -DILMBASE_INCLUDE_DIR=${LIBDIR}/ilmbase/include/
+ -DOPENEXR_HALF_LIBRARY=${LIBDIR}/ilmbase/lib/${LIBPREFIX}Half${LIBEXT}
+ -DOPENEXR_IMATH_LIBRARY=${LIBDIR}/ilmbase/lib/${LIBPREFIX}Imath-2_2${LIBEXT}
+ -DOPENEXR_ILMTHREAD_LIBRARY=${LIBDIR}/ilmbase/lib/${LIBPREFIX}IlmThread-2_2${LIBEXT}
+ -DOPENEXR_IEX_LIBRARY=${LIBDIR}/ilmbase/lib/${LIBPREFIX}Iex-2_2${LIBEXT}
+ -DOPENEXR_INCLUDE_DIR=${LIBDIR}/openexr/include/
+ -DOPENEXR_ILMIMF_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}IlmImf-2_2${LIBEXT}
+ -DSTOP_ON_WARNING=OFF
+ ${WEBP_FLAGS}
+ ${OIIO_SIMD_FLAGS}
+)
+
+ExternalProject_Add(external_openimageio
+ URL ${OPENIMAGEIO_URI}
+ DOWNLOAD_DIR ${DOWNLOAD_DIR}
+ URL_HASH MD5=${OPENIMAGEIO_HASH}
+ PREFIX ${BUILD_DIR}/openimageio
+ PATCH_COMMAND ${PATCH_CMD} -p 0 -N -d ${BUILD_DIR}/openimageio/src/external_openimageio/src/include < ${PATCH_DIR}/openimageio_gdi.diff &&
+ ${PATCH_CMD} -p 0 -N -d ${BUILD_DIR}/openimageio/src/external_openimageio/ < ${PATCH_DIR}/openimageio_staticexr.diff
+ CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openimageio ${DEFAULT_CMAKE_FLAGS} ${OPENIMAGEIO_EXTRA_ARGS}
+ INSTALL_DIR ${LIBDIR}/openimageio
+)
+
+add_dependencies(external_openimageio external_png external_zlib external_ilmbase external_openexr external_jpeg external_boost external_tiff external_opencolorio external_openjpeg${OPENJPEG_POSTFIX} ${WEBP_DEP})
+if(NOT WIN32)
+ add_dependencies(external_openimageio external_opencolorio_extra)
+endif()
diff --git a/build_files/build_environment/cmake/openjpeg.cmake b/build_files/build_environment/cmake/openjpeg.cmake
new file mode 100644
index 00000000000..406badf31fe
--- /dev/null
+++ b/build_files/build_environment/cmake/openjpeg.cmake
@@ -0,0 +1,57 @@
+# ***** 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 *****
+
+# Note the encoder/decoder may use png/tiff/lcms system libraries, but the
+# library itself does not depend on them, so should give no problems.
+
+set(OPENJPEG_EXTRA_ARGS -DBUILD_SHARED_LIBS=OFF)
+
+if(WIN32)
+ set(OPENJPEG_EXTRA_ARGS -G "MSYS Makefiles")
+else()
+ set(OPENJPEG_EXTRA_ARGS ${DEFAULT_CMAKE_FLAGS})
+endif()
+
+ExternalProject_Add(external_openjpeg
+ URL ${OPENJPEG_URI}
+ DOWNLOAD_DIR ${DOWNLOAD_DIR}
+ URL_HASH SHA256=${OPENJPEG_HASH}
+ PREFIX ${BUILD_DIR}/openjpeg
+ CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/openjpeg/src/external_openjpeg-build && ${CMAKE_COMMAND} ${OPENJPEG_EXTRA_ARGS} -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openjpeg -DBUILD_SHARED_LIBS=Off -DBUILD_THIRDPARTY=OFF ${BUILD_DIR}/openjpeg/src/external_openjpeg
+ BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/openjpeg/src/external_openjpeg-build/ && make -j${MAKE_THREADS}
+ INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/openjpeg/src/external_openjpeg-build/ && make install
+ INSTALL_DIR ${LIBDIR}/openjpeg
+)
+
+#on windows ffmpeg wants a mingw build, while oiio needs a msvc build
+if (MSVC)
+ set(OPENJPEG_EXTRA_ARGS ${DEFAULT_CMAKE_FLAGS})
+ExternalProject_Add(external_openjpeg_msvc
+ URL ${OPENJPEG_URI}
+ DOWNLOAD_DIR ${DOWNLOAD_DIR}
+ URL_HASH SHA256=${OPENJPEG_HASH}
+ PREFIX ${BUILD_DIR}/openjpeg_msvc
+ CMAKE_ARGS ${OPENJPEG_EXTRA_ARGS} -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openjpeg_msvc -DBUILD_SHARED_LIBS=Off -DBUILD_THIRDPARTY=OFF
+ INSTALL_DIR ${LIBDIR}/openjpeg_msvc
+)
+endif()
+
+ set(OPENJPEG_LIBRARY libopenjpeg${LIBEXT})
+if(MSVC)
+ set_target_properties(external_openjpeg PROPERTIES FOLDER Mingw)
+endif(MSVC)
diff --git a/build_files/build_environment/cmake/opensubdiv.cmake b/build_files/build_environment/cmake/opensubdiv.cmake
new file mode 100644
index 00000000000..5a3a4d142fa
--- /dev/null
+++ b/build_files/build_environment/cmake/opensubdiv.cmake
@@ -0,0 +1,71 @@
+# ***** 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(OPENSUBDIV_EXTRA_ARGS
+ -DNO_EXAMPLES=ON
+ -DNO_REGRESSION=ON
+ -DNO_PYTHON=ON
+ -DNO_MAYA=ON
+ -DNO_PTEX=ON
+ -DNO_DOC=ON
+ -DNO_CLEW=OFF
+ -DNO_OPENCL=OFF
+ -DNO_TUTORIALS=ON
+ -DGLEW_INCLUDE_DIR=${LIBDIR}/glew/include
+ -DGLEW_LIBRARY=${LIBDIR}/glew/lib/libGLEW${LIBEXT}
+ -DGLFW_INCLUDE_DIR=${LIBDIR}/glfw/include
+ -DGLFW_LIBRARIES=${LIBDIR}/glfw/lib/glfw3${LIBEXT}
+)
+
+if(WIN32)
+ #no cuda support for vc15 yet
+ if(msvc15)
+ set(OPENSUBDIV_CUDA ON)
+ else()
+ set(OPENSUBDIV_CUDA ON)
+ endif()
+
+ set(OPENSUBDIV_EXTRA_ARGS
+ ${OPENSUBDIV_EXTRA_ARGS}
+ -DNO_CUDA=${OPENSUBDIV_CUDA}
+ -DCLEW_INCLUDE_DIR=${LIBDIR}/clew/include/cl
+ -DCLEW_LIBRARY=${LIBDIR}/clew/lib/clew${LIBEXT}
+ -DCUEW_INCLUDE_DIR=${LIBDIR}/cuew/include
+ -DCUEW_LIBRARY=${LIBDIR}/cuew/lib/cuew${LIBEXT}
+ -DCMAKE_EXE_LINKER_FLAGS_RELEASE=libcmt.lib
+ )
+else()
+ set(OPENSUBDIV_EXTRA_ARGS
+ ${OPENSUBDIV_EXTRA_ARGS}
+ -DNO_CUDA=ON
+ -DCUEW_INCLUDE_DIR=${LIBDIR}/cuew/include
+ -DCLEW_LIBRARY=${LIBDIR}/clew/lib/static/${LIBPREFIX}clew${LIBEXT}
+ )
+endif()
+
+ExternalProject_Add(external_opensubdiv
+ URL ${OPENSUBDIV_URI}
+ DOWNLOAD_DIR ${DOWNLOAD_DIR}
+ URL_HASH MD5=${OPENSUBDIV_Hash}
+ PREFIX ${BUILD_DIR}/opensubdiv
+ PATCH_COMMAND ${PATCH_CMD} --verbose -p 1 -N -d ${BUILD_DIR}/opensubdiv/src/external_opensubdiv < ${PATCH_DIR}/opensubdiv.diff
+ CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/opensubdiv -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${OPENSUBDIV_EXTRA_ARGS}
+ INSTALL_DIR ${LIBDIR}/opensubdiv
+)
+
+add_dependencies(external_opensubdiv external_glew external_glfw external_clew external_cuew)
diff --git a/build_files/build_environment/cmake/openvdb.cmake b/build_files/build_environment/cmake/openvdb.cmake
new file mode 100644
index 00000000000..a71598c1a3b
--- /dev/null
+++ b/build_files/build_environment/cmake/openvdb.cmake
@@ -0,0 +1,71 @@
+# ***** 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(BUILD_MODE STREQUAL Debug)
+ set(BLOSC_POST _d)
+endif()
+
+set(OPENVDB_EXTRA_ARGS
+ -DILMBASE_HOME=${LIBDIR}/ilmbase/
+ -DILMBASE_CUSTOM=ON
+ -DILMBASE_CUSTOM_LIBRARIES=Half;Imath-2_2;IlmThread-2_2;Iex-2_2
+ -DILMBASE_INCLUDE_DIR=${LIBDIR}/ilmbase/include/
+ -DILMBASE_HALF_LIBRARIES=${LIBDIR}/ilmbase/lib/Half${LIBEXT}
+ -DILMBASE_IMATH_LIBRARIES=${LIBDIR}/ilmbase/lib/${LIBPREFIX}Imath-2_2${LIBEXT}
+ -DILMBASE_ILMTHREAD_LIBRARIES=${LIBDIR}/ilmbase/lib/${LIBPREFIX}IlmThread-2_2${LIBEXT}
+ -DILMBASE_IEX_LIBRARIES=${LIBDIR}/ilmbase/lib/${LIBPREFIX}Iex-2_2${LIBEXT}
+ -DOPENEXR_HOME=${LIBDIR}/openexr/
+ -DOPENEXR_USE_STATIC_LIBS=ON
+ -DOPENEXR_CUSTOM=ON
+ -DOPENEXR_CUSTOM_LIBRARY=IlmImf-2_2
+ -DOPENEXR_INCLUDE_DIR=${LIBDIR}/openexr/include/
+ -DOPENEXR_ILMIMF_LIBRARIES=${LIBDIR}/openexr/lib/${LIBPREFIX}IlmImf-2_2${LIBEXT}
+ -DTBB_ROOT_DIR=${LIBDIR}/tbb/
+ -DTBB_INCLUDE_DIRS=${LIBDIR}/tbb/include
+ -DTBB_LIBRARY=${LIBDIR}/tbb/lib/tbb_static${LIBEXT}
+ -DBoost_COMPILER:STRING=${BOOST_COMPILER_STRING}
+ -DBoost_USE_MULTITHREADED=ON
+ -DBoost_USE_STATIC_LIBS=ON
+ -DBoost_USE_STATIC_RUNTIME=ON
+ -DBOOST_ROOT=${LIBDIR}/boost
+ -DBoost_NO_SYSTEM_PATHS=ON
+ -DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
+ -DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include/
+ -DWITH_BLOSC=ON
+ -DBLOSC_INCLUDE_DIR=${LIBDIR}/blosc/include/
+ -DBLOSC_LIBRARY=${LIBDIR}/blosc/lib/libblosc${BLOSC_POST}${LIBEXT}
+)
+
+set(OPENVDB_EXTRA_ARGS ${OPENVDB_EXTRA_ARGS})
+
+# CMake script for OpenVDB based on https://raw.githubusercontent.com/diekev/openvdb-cmake/master/CMakeLists.txt
+# can't be in external_openvdb because of how the includes are setup.
+
+ExternalProject_Add(openvdb
+ URL ${OPENVDB_URI}
+ DOWNLOAD_DIR ${DOWNLOAD_DIR}
+ URL_HASH MD5=${OPENVDB_HASH}
+ PREFIX ${BUILD_DIR}/openvdb
+ PATCH_COMMAND COMMAND ${CMAKE_COMMAND} -E copy ${PATCH_DIR}/cmakelists_openvdb.txt ${BUILD_DIR}/openvdb/src/openvdb/CMakeLists.txt &&
+ ${CMAKE_COMMAND} -E copy_directory ${PATCH_DIR}/cmake/ ${BUILD_DIR}/openvdb/src/openvdb/cmake/ &&
+ ${PATCH_CMD} --verbose -p 0 -N -d ${BUILD_DIR}/openvdb/src/openvdb < ${PATCH_DIR}/openvdb_vc2013.diff
+ CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openvdb ${DEFAULT_CMAKE_FLAGS} ${OPENVDB_EXTRA_ARGS}
+ INSTALL_DIR ${LIBDIR}/openvdb
+)
+
+add_dependencies(openvdb external_tbb external_boost external_ilmbase external_openexr external_zlib external_blosc)
diff --git a/build_files/build_environment/cmake/options.cmake b/build_files/build_environment/cmake/options.cmake
new file mode 100644
index 00000000000..9979a682614
--- /dev/null
+++ b/build_files/build_environment/cmake/options.cmake
@@ -0,0 +1,210 @@
+# ***** 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(WIN32)
+ option(ENABLE_MINGW64 "Enable building of ffmpeg/iconv/libsndfile/lapack/fftw3 by installing mingw64" ON)
+endif()
+option(WITH_WEBP "Enable building of oiio with webp support" OFF)
+set(MAKE_THREADS 1 CACHE STRING "Number of threads to run make with")
+
+if(NOT BUILD_MODE)
+ set(BUILD_MODE "Release")
+ message(STATUS "Build type not specified: defaulting to a release build.")
+endif()
+Message("BuildMode = ${BUILD_MODE}")
+
+if(BUILD_MODE STREQUAL "Debug")
+ set(LIBDIR ${CMAKE_CURRENT_BINARY_DIR}/Debug)
+ELSE(BUILD_MODE STREQUAL "Debug")
+ set(LIBDIR ${CMAKE_CURRENT_BINARY_DIR}/Release)
+ENDIF(BUILD_MODE STREQUAL "Debug")
+
+option(DOWNLOAD_DIR "Path for downloaded files" ${CMAKE_CURRENT_SOURCE_DIR}/downloads)
+file(TO_CMAKE_PATH ${DOWNLOAD_DIR} DOWNLOAD_DIR)
+set(PATCH_DIR ${CMAKE_CURRENT_SOURCE_DIR}/patches)
+set(BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/build)
+
+message("LIBDIR = ${LIBDIR}")
+message("DOWNLOAD_DIR = ${DOWNLOAD_DIR}")
+message("PATCH_DIR = ${PATCH_DIR}")
+message("BUILD_DIR = ${BUILD_DIR}")
+
+if(WIN32)
+ if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
+ set(PATCH_CMD ${DOWNLOAD_DIR}/mingw/mingw64/msys/1.0/bin/patch.exe)
+ else()
+ set(PATCH_CMD ${DOWNLOAD_DIR}/mingw/mingw32/msys/1.0/bin/patch.exe)
+ endif()
+ set(LIBEXT ".lib")
+ set(LIBPREFIX "")
+
+ # For OIIO and OSL
+ set(COMMON_DEFINES /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS)
+
+ # TODO FIXME highly MSVC specific
+ if(WITH_OPTIMIZED_DEBUG)
+ set(BLENDER_CMAKE_C_FLAGS_DEBUG "/MTd /O2 /Ob2 /DNDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
+ else()
+ set(BLENDER_CMAKE_C_FLAGS_DEBUG "/MTd /Zi /Ob0 /Od /RTC1 /D_DEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
+ endif()
+ set(BLENDER_CMAKE_C_FLAGS_MINSIZEREL "/MT /O1 /Ob1 /D NDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
+ set(BLENDER_CMAKE_C_FLAGS_RELEASE "/MT /O2 /Ob2 /DNDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
+ set(BLENDER_CMAKE_C_FLAGS_RELWITHDEBINFO "/MT /Zi /O2 /Ob1 /D NDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
+
+ if(WITH_OPTIMIZED_DEBUG)
+ set(BLENDER_CMAKE_CXX_FLAGS_DEBUG "/MTd /O2 /Ob2 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
+ else()
+ set(BLENDER_CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG /D PLATFORM_WINDOWS /MTd /Zi /Ob0 /Od /RTC1 /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
+ endif()
+ set(BLENDER_CMAKE_CXX_FLAGS_MINSIZEREL "/MT /O1 /Ob1 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
+ set(BLENDER_CMAKE_CXX_FLAGS_RELEASE "/MT /O2 /Ob2 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
+ set(BLENDER_CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MT /Zi /O2 /Ob1 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
+
+ set(PLATFORM_FLAGS)
+ set(PLATFORM_CXX_FLAGS)
+ set(PLATFORM_CMAKE_FLAGS)
+
+ if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
+ set(MINGW_PATH ${DOWNLOAD_DIR}/mingw/mingw64)
+ set(MINGW_SHELL ming64sh.cmd)
+ set(PERL_SHELL ${DOWNLOAD_DIR}/perl/portableshell.bat)
+ set(MINGW_HOST x86_64-w64-mingw32)
+ else()
+ set(MINGW_PATH ${DOWNLOAD_DIR}/mingw/mingw32)
+ set(MINGW_SHELL ming32sh.cmd)
+ set(PERL_SHELL ${DOWNLOAD_DIR}/perl32/portableshell.bat)
+ set(MINGW_HOST i686-w64-mingw32)
+ endif()
+
+ set(CONFIGURE_ENV
+ cd ${MINGW_PATH} &&
+ call ${MINGW_SHELL} &&
+ call ${PERL_SHELL} &&
+ set path &&
+ set CFLAGS=-g &&
+ set LDFLAGS=-Wl,--as-needed -static-libgcc
+ )
+
+ set(CONFIGURE_ENV_NO_PERL
+ cd ${MINGW_PATH} &&
+ call ${MINGW_SHELL} &&
+ set path &&
+ set CFLAGS=-g &&
+ set LDFLAGS=-Wl,--as-needed -static-libgcc
+ )
+
+ set(CONFIGURE_COMMAND sh ./configure)
+ set(CONFIGURE_COMMAND_NO_TARGET ${CONFIGURE_COMMAND})
+else()
+ set(PATCH_CMD patch)
+ set(LIBEXT ".a")
+ set(LIBPREFIX "lib")
+
+ if(APPLE)
+# Let's get the current Xcode dir, to support xcode-select
+ execute_process(
+ COMMAND xcode-select --print-path
+ OUTPUT_VARIABLE XCODE_DEV_PATH OUTPUT_STRIP_TRAILING_WHITESPACE)
+ set(OSX_ARCHITECTURES x86_64)
+ set(OSX_DEPLOYMENT_TARGET 10.9)
+ set(OSX_SDK_VERSION 10.12)
+ set(OSX_SYSROOT ${XCODE_DEV_PATH}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX${OSX_SDK_VERSION}.sdk)
+
+ set(PLATFORM_CFLAGS "-isysroot ${OSX_SYSROOT} -mmacosx-version-min=${OSX_DEPLOYMENT_TARGET}")
+ set(PLATFORM_CXXFLAGS "-isysroot ${OSX_SYSROOT} -mmacosx-version-min=${OSX_DEPLOYMENT_TARGET} -std=c++11 -stdlib=libc++")
+ set(PLATFORM_LDFLAGS "-isysroot ${OSX_SYSROOT} -mmacosx-version-min=${OSX_DEPLOYMENT_TARGET}")
+ set(PLATFORM_BUILD_TARGET --build=x86_64-apple-darwin13.0.0) # OS X 10.9
+ set(PLATFORM_CMAKE_FLAGS
+ -DCMAKE_OSX_ARCHITECTURES:STRING=${OSX_ARCHITECTURES}
+ -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=${OSX_DEPLOYMENT_TARGET}
+ -DCMAKE_OSX_SYSROOT:PATH=${OSX_SYSROOT}
+ )
+ else()
+ set(PLATFORM_CFLAGS "-fPIC")
+ set(PLATFORM_CXXFLAGS "-std=c++11 -fPIC")
+ set(PLATFORM_LDFLAGS)
+ set(PLATFORM_BUILD_TARGET)
+ set(PLATFORM_CMAKE_FLAGS)
+ endif()
+
+ if(WITH_OPTIMIZED_DEBUG)
+ set(BLENDER_CMAKE_C_FLAGS_DEBUG "-O2 -DNDEBUG")
+ else()
+ set(BLENDER_CMAKE_C_FLAGS_DEBUG "-g")
+ endif()
+ set(BLENDER_CMAKE_C_FLAGS_MINSIZEREL "-Os -DNDEBUG")
+ set(BLENDER_CMAKE_C_FLAGS_RELEASE "-O2 -DNDEBUG")
+ set(BLENDER_CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g -DNDEBUG")
+
+ if(WITH_OPTIMIZED_DEBUG)
+ set(BLENDER_CMAKE_CXX_FLAGS_DEBUG "-O2 -DNDEBUG ${PLATFORM_CXXFLAGS}")
+ else()
+ set(BLENDER_CMAKE_CXX_FLAGS_DEBUG "-g ${PLATFORM_CXXFLAGS}")
+ endif()
+
+ set(BLENDER_CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG ${PLATFORM_CXXFLAGS}")
+ set(BLENDER_CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG ${PLATFORM_CXXFLAGS}")
+ set(BLENDER_CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -DNDEBUG ${PLATFORM_CXXFLAGS}")
+
+ set(CONFIGURE_ENV
+ export MACOSX_DEPLOYMENT_TARGET=${OSX_DEPLOYMENT_TARGET} &&
+ export CFLAGS=${PLATFORM_CFLAGS} &&
+ export CXXFLAGS=${PLATFORM_CXXFLAGS} &&
+ export LDFLAGS=${PLATFORM_LDFLAGS}
+ )
+ set(CONFIGURE_ENV_NO_PERL ${CONFIGURE_ENV})
+ set(CONFIGURE_COMMAND ./configure ${PLATFORM_BUILD_TARGET})
+ set(CONFIGURE_COMMAND_NO_TARGET ./configure)
+endif()
+
+set(DEFAULT_CMAKE_FLAGS
+ -DCMAKE_BUILD_TYPE=${BUILD_MODE}
+ -DCMAKE_C_FLAGS_DEBUG=${BLENDER_CMAKE_C_FLAGS_DEBUG}
+ -DCMAKE_C_FLAGS_MINSIZEREL=${BLENDER_CMAKE_C_FLAGS_MINSIZEREL}
+ -DCMAKE_C_FLAGS_RELEASE=${BLENDER_CMAKE_C_FLAGS_RELEASE}
+ -DCMAKE_C_FLAGS_RELWITHDEBINFO=${BLENDER_CMAKE_C_FLAGS_RELWITHDEBINFO}
+ -DCMAKE_CXX_FLAGS_DEBUG=${BLENDER_CMAKE_CXX_FLAGS_DEBUG}
+ -DCMAKE_CXX_FLAGS_MINSIZEREL=${BLENDER_CMAKE_CXX_FLAGS_MINSIZEREL}
+ -DCMAKE_CXX_FLAGS_RELEASE=${BLENDER_CMAKE_CXX_FLAGS_RELEASE}
+ -DCMAKE_CXX_FLAGS_RELWITHDEBINFO=${CMAKE_CXX_FLAGS_RELWITHDEBINFO}
+ ${PLATFORM_CMAKE_FLAGS}
+)
+
+if(WIN32)
+ #we need both flavors to build the thumbnail dlls
+ if(MSVC12)
+ set(GENERATOR_32 "Visual Studio 12 2013")
+ set(GENERATOR_64 "Visual Studio 12 2013 Win64")
+ elseif(MSVC14)
+ set(GENERATOR_32 "Visual Studio 14 2015")
+ set(GENERATOR_64 "Visual Studio 14 2015 Win64")
+ endif()
+endif()
+
+
+if(WIN32)
+ set(ZLIB_LIBRARY zlibstatic${LIBEXT})
+else()
+ set(ZLIB_LIBRARY libz${LIBEXT})
+endif()
+
+if(MSVC)
+ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
+endif()
+
+set(CMAKE_INSTALL_MESSAGE LAZY)
diff --git a/build_files/build_environment/cmake/orc.cmake b/build_files/build_environment/cmake/orc.cmake
new file mode 100644
index 00000000000..aac7884f49e
--- /dev/null
+++ b/build_files/build_environment/cmake/orc.cmake
@@ -0,0 +1,32 @@
+# ***** 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 *****
+
+ExternalProject_Add(external_orc
+ URL ${ORC_URI}
+ DOWNLOAD_DIR ${DOWNLOAD_DIR}
+ URL_HASH SHA256=${ORC_HASH}
+ PREFIX ${BUILD_DIR}/orc
+ CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/orc/src/external_orc/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/orc --disable-shared --enable-static
+ BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/orc/src/external_orc/ && make -j${MAKE_THREADS}
+ INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/orc/src/external_orc/ && make install
+ INSTALL_DIR ${LIBDIR}/orc
+)
+
+if(MSVC)
+ set_target_properties(external_orc PROPERTIES FOLDER Mingw)
+endif()
diff --git a/build_files/build_environment/cmake/osl.cmake b/build_files/build_environment/cmake/osl.cmake
new file mode 100644
index 00000000000..5ddb981c604
--- /dev/null
+++ b/build_files/build_environment/cmake/osl.cmake
@@ -0,0 +1,87 @@
+# ***** 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(WIN32)
+ set(OSL_CMAKE_CXX_STANDARD_LIBRARIES "kernel32${LIBEXT} user32${LIBEXT} gdi32${LIBEXT} winspool${LIBEXT} shell32${LIBEXT} ole32${LIBEXT} oleaut32${LIBEXT} uuid${LIBEXT} comdlg32${LIBEXT} advapi32${LIBEXT} psapi${LIBEXT}")
+ set(OSL_FLEX_BISON -DFLEX_EXECUTABLE=${LIBDIR}/flexbison/win_flex.exe -DFLEX_EXTRA_OPTIONS="--wincompat" -DBISON_EXECUTABLE=${LIBDIR}/flexbison/win_bison.exe)
+ set(OSL_OPENIMAGEIO_LIBRARY "${LIBDIR}/openimageio/lib/${LIBPREFIX}OpenImageIO${LIBEXT};${LIBDIR}/openimageio/lib/${LIBPREFIX}OpenImageIO_Util${LIBEXT};${LIBDIR}/png/lib/libpng16${LIBEXT};${LIBDIR}/jpg/lib/${LIBPREFIX}jpeg${LIBEXT};${LIBDIR}/tiff/lib/${LIBPREFIX}tiff${LIBEXT};${LIBDIR}/openexr/lib/${LIBPREFIX}IlmImf-2_2${LIBEXT}")
+ if("${CMAKE_SIZEOF_VOID_P}" EQUAL "4")
+ set(OSL_SIMD_FLAGS -DOIIO_NOSIMD=1 -DOIIO_SIMD=0)
+ else()
+ set(OSL_SIMD_FLAGS -DOIIO_NOSIMD=1 -DOIIO_SIMD=sse2)
+ endif()
+else()
+ set(OSL_CMAKE_CXX_STANDARD_LIBRARIES)
+ set(OSL_FLEX_BISON)
+ set(OSL_OPENIMAGEIO_LIBRARY "${LIBDIR}/openimageio/lib/${LIBPREFIX}OpenImageIO${LIBEXT};${LIBDIR}/openimageio/lib/${LIBPREFIX}OpenImageIO_Util${LIBEXT};${LIBDIR}/png/lib/${LIBPREFIX}png16${LIBEXT};${LIBDIR}/jpg/lib/${LIBPREFIX}jpeg${LIBEXT};${LIBDIR}/tiff/lib/${LIBPREFIX}tiff${LIBEXT};${LIBDIR}/openexr/lib/${LIBPREFIX}IlmImf-2_2${LIBEXT}")
+endif()
+
+set(OSL_ILMBASE_CUSTOM_LIBRARIES "${LIBDIR}/ilmbase/lib/Imath-2_2.lib^^${LIBDIR}/ilmbase/lib/Half.lib^^${LIBDIR}/ilmbase/lib/IlmThread-2_2.lib^^${LIBDIR}/ilmbase/lib/Iex-2_2.lib")
+set(OSL_LLVM_LIBRARY "${LIBDIR}/llvm/lib/LLVMAnalysis${LIBEXT};${LIBDIR}/llvm/lib/LLVMAsmParser${LIBEXT};${LIBDIR}/llvm/lib/LLVMAsmPrinter${LIBEXT};${LIBDIR}/llvm/lib/LLVMBitReader${LIBEXT};${LIBDIR}/llvm/lib/LLVMBitWriter${LIBEXT};${LIBDIR}/llvm/lib/LLVMCodeGen${LIBEXT};${LIBDIR}/llvm/lib/LLVMCore${LIBEXT};${LIBDIR}/llvm/lib/LLVMDebugInfo${LIBEXT};${LIBDIR}/llvm/lib/LLVMExecutionEngine${LIBEXT};${LIBDIR}/llvm/lib/LLVMInstCombine${LIBEXT};${LIBDIR}/llvm/lib/LLVMInstrumentation${LIBEXT};${LIBDIR}/llvm/lib/LLVMInterpreter${LIBEXT};${LIBDIR}/llvm/lib/LLVMJIT${LIBEXT};${LIBDIR}/llvm/lib/LLVMLinker${LIBEXT};${LIBDIR}/llvm/lib/LLVMMC${LIBEXT};${LIBDIR}/llvm/lib/LLVMMCDisassembler${LIBEXT};${LIBDIR}/llvm/lib/LLVMMCJIT${LIBEXT};${LIBDIR}/llvm/lib/LLVMMCParser${LIBEXT};${LIBDIR}/llvm/lib/LLVMObject${LIBEXT};${LIBDIR}/llvm/lib/LLVMRuntimeDyld${LIBEXT};${LIBDIR}/llvm/lib/LLVMScalarOpts${LIBEXT};${LIBDIR}/llvm/lib/LLVMSelectionDAG${LIBEXT};${LIBDIR}/llvm/lib/LLVMSupport${LIBEXT};${LIBDIR}/llvm/lib/LLVMTableGen${LIBEXT};${LIBDIR}/llvm/lib/LLVMTarget${LIBEXT};${LIBDIR}/llvm/lib/LLVMTransformUtils${LIBEXT};${LIBDIR}/llvm/lib/LLVMVectorize${LIBEXT};${LIBDIR}/llvm/lib/LLVMX86AsmParser${LIBEXT};${LIBDIR}/llvm/lib/LLVMX86AsmPrinter${LIBEXT};${LIBDIR}/llvm/lib/LLVMX86CodeGen${LIBEXT};${LIBDIR}/llvm/lib/LLVMX86Desc${LIBEXT};${LIBDIR}/llvm/lib/LLVMX86Disassembler${LIBEXT};${LIBDIR}/llvm/lib/LLVMX86Info${LIBEXT};${LIBDIR}/llvm/lib/LLVMX86Utils${LIBEXT};${LIBDIR}/llvm/lib/LLVMipa${LIBEXT};${LIBDIR}/llvm/lib/LLVMipo${LIBEXT}")
+
+set(OSL_EXTRA_ARGS
+ -DBoost_COMPILER:STRING=${BOOST_COMPILER_STRING}
+ -DBoost_USE_MULTITHREADED=ON
+ -DBoost_USE_STATIC_LIBS=ON
+ -DBoost_USE_STATIC_RUNTIME=ON
+ -DBOOST_ROOT=${LIBDIR}/boost
+ -DBOOST_LIBRARYDIR=${LIBDIR}/boost/lib/
+ -DBoost_NO_SYSTEM_PATHS=ON
+ -DLLVM_DIRECTORY=${LIBDIR}/llvm
+ -DLLVM_INCLUDES=${LIBDIR}/llvm/include
+ -DLLVM_LIB_DIR=${LIBDIR}/llvm/lib
+ -DLLVM_VERSION=3.4
+ -DLLVM_LIBRARY=${OSL_LLVM_LIBRARY}
+ -DOPENEXR_HOME=${LIBDIR}/openexr/
+ -DILMBASE_HOME=${LIBDIR}/ilmbase/
+ -DILMBASE_INCLUDE_DIR=${LIBDIR}/ilmbase/include/
+ -DOPENEXR_IMATH_LIBRARY=${LIBDIR}/ilmbase/lib/${LIBPREFIX}Imath-2_2${LIBEXT}
+ -DOPENEXR_ILMTHREAD_LIBRARY=${LIBDIR}/ilmbase/lib/${LIBPREFIX}IlmThread-2_2${LIBEXT}
+ -DOPENEXR_IEX_LIBRARY=${LIBDIR}/ilmbase/lib/${LIBPREFIX}Iex-2_2${LIBEXT}
+ -DOPENEXR_INCLUDE_DIR=${LIBDIR}/openexr/include/
+ -DOPENEXR_ILMIMF_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}IlmImf-2_2${LIBEXT}
+ -DOSL_BUILD_TESTS=OFF
+ -DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
+ -DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include/
+ -DOPENIMAGEIOHOME=${LIBDIR}/openimageio/
+ -DOPENIMAGEIO_LIBRARY=${OSL_OPENIMAGEIO_LIBRARY}
+ -DOPENIMAGEIO_INCLUDES=${LIBDIR}/openimageio/include
+ ${OSL_FLEX_BISON}
+ -DCMAKE_CXX_STANDARD_LIBRARIES=${OSL_CMAKE_CXX_STANDARD_LIBRARIES}
+ -DBUILDSTATIC=ON
+ -DLINKSTATIC=ON
+ -DOSL_BUILD_PLUGINS=Off
+ -DSTOP_ON_WARNING=OFF
+ -DOSL_BUILD_CPP11=ON
+ -DUSE_LLVM_BITCODE=OFF
+ ${OSL_SIMD_FLAGS}
+)
+
+ExternalProject_Add(external_osl
+ URL ${OSL_URI}
+ DOWNLOAD_DIR ${DOWNLOAD_DIR}
+ LIST_SEPARATOR ^^
+ URL_HASH MD5=${OSL_HASH}
+ PREFIX ${BUILD_DIR}/osl
+ PATCH_COMMAND ${PATCH_CMD} -p 3 -d ${BUILD_DIR}/osl/src/external_osl < ${PATCH_DIR}/osl.diff &&
+ ${PATCH_CMD} -p 0 -d ${BUILD_DIR}/osl/src/external_osl < ${PATCH_DIR}/osl_simd_oiio.diff
+ CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/osl -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} ${DEFAULT_CMAKE_FLAGS} ${OSL_EXTRA_ARGS}
+ INSTALL_DIR ${LIBDIR}/osl
+)
+
+add_dependencies(external_osl external_boost ll external_clang external_ilmbase external_openexr external_zlib external_flexbison external_openimageio)
diff --git a/build_files/build_environment/cmake/png.cmake b/build_files/build_environment/cmake/png.cmake
new file mode 100644
index 00000000000..8d6fee871f9
--- /dev/null
+++ b/build_files/build_environment/cmake/png.cmake
@@ -0,0 +1,41 @@
+# ***** 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(PNG_EXTRA_ARGS
+ -DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
+ -DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include/
+ -DPNG_STATIC=ON
+)
+
+ExternalProject_Add(external_png
+ URL ${PNG_URI}
+ DOWNLOAD_DIR ${DOWNLOAD_DIR}
+ URL_HASH MD5=${PNG_HASH}
+ PREFIX ${BUILD_DIR}/png
+ CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/png ${DEFAULT_CMAKE_FLAGS} ${PNG_EXTRA_ARGS}
+ INSTALL_DIR ${LIBDIR}/png
+)
+
+add_dependencies(external_png external_zlib)
+
+if(BUILD_MODE STREQUAL Debug)
+ ExternalProject_Add_Step(external_png after_install
+ COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/png/lib/libpng16_staticd${LIBEXT} ${LIBDIR}/png/lib/libpng16${LIBEXT}
+ DEPENDEES install
+ )
+endif()
diff --git a/build_files/build_environment/cmake/pthreads.cmake b/build_files/build_environment/cmake/pthreads.cmake
new file mode 100644
index 00000000000..f4301b95f3a
--- /dev/null
+++ b/build_files/build_environment/cmake/pthreads.cmake
@@ -0,0 +1,45 @@
+# ***** 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(WIN32)
+ set(PTHREAD_XCFLAGS /MD)
+
+ if(MSVC14) # vs2015 has timespec
+ set(PTHREAD_CPPFLAGS "/I. /DHAVE_PTW32_CONFIG_H /D_TIMESPEC_DEFINED ")
+ else() # everything before doesn't
+ set(PTHREAD_CPPFLAGS "/I. /DHAVE_PTW32_CONFIG_H ")
+ endif()
+
+ set(PTHREADS_BUILD cd ${BUILD_DIR}/pthreads/src/external_pthreads/ && cd && nmake VC /e CPPFLAGS=${PTHREAD_CPPFLAGS} /e XCFLAGS=${PTHREAD_XCFLAGS} /e XLIBS=/NODEFAULTLIB:msvcr)
+
+ ExternalProject_Add(external_pthreads
+ URL ${PTHREADS_URI}
+ DOWNLOAD_DIR ${DOWNLOAD_DIR}
+ URL_HASH SHA512=${PTHREADS_SHA512}
+ PREFIX ${BUILD_DIR}/pthreads
+ CONFIGURE_COMMAND echo .
+ PATCH_COMMAND ${PATCH_CMD} --verbose -p 0 -N -d ${BUILD_DIR}/pthreads/src/external_pthreads < ${PATCH_DIR}/pthreads.diff
+ BUILD_COMMAND ${PTHREADS_BUILD}
+ INSTALL_COMMAND COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/pthreads/src/external_pthreads/pthreadVC2.dll ${LIBDIR}/pthreads/lib/pthreadVC2.dll &&
+ ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/pthreads/src/external_pthreads/pthreadVC2${LIBEXT} ${LIBDIR}/pthreads/lib/pthreadVC2${LIBEXT} &&
+ ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/pthreads/src/external_pthreads/pthread.h ${LIBDIR}/pthreads/inc/pthread.h &&
+ ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/pthreads/src/external_pthreads/sched.h ${LIBDIR}/pthreads/inc/sched.h &&
+ ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/pthreads/src/external_pthreads/semaphore.h ${LIBDIR}/pthreads/inc/semaphore.h
+ INSTALL_DIR ${LIBDIR}/pthreads
+ )
+endif()
diff --git a/build_files/build_environment/cmake/python.cmake b/build_files/build_environment/cmake/python.cmake
new file mode 100644
index 00000000000..98d9d4ae63e
--- /dev/null
+++ b/build_files/build_environment/cmake/python.cmake
@@ -0,0 +1,138 @@
+# ***** 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(PYTHON_POSTFIX)
+if(BUILD_MODE STREQUAL Debug)
+ set(PYTHON_POSTFIX _d)
+endif()
+
+if(WIN32)
+ set(PYTHON_BINARY ${BUILD_DIR}/python/src/external_python/run/python${PYTHON_POSTFIX}.exe)
+
+ macro(cmake_to_dos_path MsysPath ResultingPath)
+ string(REPLACE "/" "\\" ${ResultingPath} "${MsysPath}")
+ endmacro()
+
+ set(PYTHON_EXTERNALS_FOLDER ${BUILD_DIR}/python/src/external_python/externals)
+ set(DOWNLOADS_EXTERNALS_FOLDER ${DOWNLOAD_DIR}/externals)
+
+ cmake_to_dos_path(${PYTHON_EXTERNALS_FOLDER} PYTHON_EXTERNALS_FOLDER_DOS)
+ cmake_to_dos_path(${DOWNLOADS_EXTERNALS_FOLDER} DOWNLOADS_EXTERNALS_FOLDER_DOS)
+
+ message("Python externals = ${PYTHON_EXTERNALS_FOLDER}")
+ message("Python externals_dos = ${PYTHON_EXTERNALS_FOLDER_DOS}")
+ message("Python DOWNLOADS_EXTERNALS_FOLDER = ${DOWNLOADS_EXTERNALS_FOLDER}")
+ message("Python DOWNLOADS_EXTERNALS_FOLDER_DOS = ${DOWNLOADS_EXTERNALS_FOLDER_DOS}")
+
+ ExternalProject_Add(external_python
+ URL ${PYTHON_URI}
+ DOWNLOAD_DIR ${DOWNLOAD_DIR}
+ URL_HASH MD5=${PYTHON_HASH}
+ PREFIX ${BUILD_DIR}/python
+ PATCH_COMMAND echo mklink /D "${PYTHON_EXTERNALS_FOLDER_DOS}" "${DOWNLOADS_EXTERNALS_FOLDER_DOS}" &&
+ mklink /D "${PYTHON_EXTERNALS_FOLDER_DOS}" "${DOWNLOADS_EXTERNALS_FOLDER_DOS}" &&
+ ${PATCH_CMD} --verbose -p 0 -d ${BUILD_DIR}/python/src/external_python < ${PATCH_DIR}/python.diff &&
+ ${PATCH_CMD} --verbose -p 0 -d ${BUILD_DIR}/python/src/external_python/pc < ${PATCH_DIR}/pyshell.diff
+ CONFIGURE_COMMAND ""
+ BUILD_COMMAND cd ${BUILD_DIR}/python/src/external_python/pcbuild/ && set IncludeTkinter=false && call build.bat -e -p ${PYTHON_ARCH} -c ${BUILD_MODE} -k ${PYTHON_COMPILER_STRING}
+ INSTALL_COMMAND COMMAND ${CMAKE_COMMAND} -E copy ${PYTHON_OUTPUTDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.dll ${LIBDIR}/python/lib/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.dll &&
+ ${CMAKE_COMMAND} -E copy ${PYTHON_OUTPUTDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.lib ${LIBDIR}/python/lib/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.lib &&
+ ${CMAKE_COMMAND} -E copy ${PYTHON_OUTPUTDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.exp ${LIBDIR}/python/lib/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.exp &&
+ ${CMAKE_COMMAND} -E copy_directory ${BUILD_DIR}/python/src/external_python/include ${LIBDIR}/python/include/Python${PYTHON_SHORT_VERSION} &&
+ ${CMAKE_COMMAND} -E copy "${BUILD_DIR}/python/src/external_python/PC/pyconfig.h" ${LIBDIR}/python/include/Python${PYTHON_SHORT_VERSION}/pyconfig.h
+ )
+ Message("PythinRedist = ${BUILD_DIR}/python/src/external_python/redist")
+ Message("POutput = ${PYTHON_OUTPUTDIR}")
+else()
+ if(APPLE)
+ # we need to manually add homebrew headers to get ssl module building
+ set(PYTHON_CFLAGS "-I/usr/local/opt/openssl/include -I${OSX_SYSROOT}/usr/include ${PLATFORM_CFLAGS}")
+ set(PYTHON_LDFLAGS "-L/usr/local/opt/openssl/lib ${PLATFORM_LDFLAGS}")
+ set(PYTHON_CONFIGURE_ENV ${CONFIGURE_ENV} && export CFLAGS=${PYTHON_CFLAGS} && export LDFLAGS=${PYTHON_LDFLAGS})
+ set(PYTHON_BINARY ${BUILD_DIR}/python/src/external_python/python.exe)
+ set(PYTHON_PATCH ${PATCH_CMD} --verbose -p 0 -d ${BUILD_DIR}/python/src/external_python < ${PATCH_DIR}/python_apple.diff)
+ else()
+ set(PYTHON_CONFIGURE_ENV ${CONFIGURE_ENV})
+ set(PYTHON_BINARY ${BUILD_DIR}/python/src/external_python/python)
+ endif()
+
+ ExternalProject_Add(external_python
+ URL ${PYTHON_URI}
+ DOWNLOAD_DIR ${DOWNLOAD_DIR}
+ URL_HASH MD5=${PYTHON_HASH}
+ PREFIX ${BUILD_DIR}/python
+ PATCH_COMMAND ${PYTHON_PATCH}
+ CONFIGURE_COMMAND ${PYTHON_CONFIGURE_ENV} && cd ${BUILD_DIR}/python/src/external_python/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/python
+ BUILD_COMMAND ${PYTHON_CONFIGURE_ENV} && cd ${BUILD_DIR}/python/src/external_python/ && make -j${MAKE_THREADS}
+ INSTALL_COMMAND ${PYTHON_CONFIGURE_ENV} && cd ${BUILD_DIR}/python/src/external_python/ && make install
+ INSTALL_DIR ${LIBDIR}/python)
+
+ add_custom_target(Make_Python_Environment ALL DEPENDS external_python)
+endif()
+
+if(MSVC)
+ add_custom_command(
+ OUTPUT ${LIBDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.tar.gz
+ OUTPUT ${BUILD_DIR}/python/src/external_python/redist/bin/python${PYTHON_POSTFIX}.exe
+ COMMAND ${CMAKE_COMMAND} -E copy_directory ${BUILD_DIR}/python/src/external_python/lib ${BUILD_DIR}/python/src/external_python/redist/lib
+ COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/python${PYTHON_POSTFIX}.exe" ${BUILD_DIR}/python/src/external_python/redist/bin/python${PYTHON_POSTFIX}.exe
+ COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_bz2${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_bz2${PYTHON_POSTFIX}.pyd
+ COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_hashlib${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_hashlib${PYTHON_POSTFIX}.pyd
+ COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_lzma${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_lzma${PYTHON_POSTFIX}.pyd
+ COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_sqlite3${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_sqlite3${PYTHON_POSTFIX}.pyd
+ COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_ssl${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_ssl${PYTHON_POSTFIX}.pyd
+ COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/pyexpat${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/pyexpat${PYTHON_POSTFIX}.pyd
+ COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/select${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/select${PYTHON_POSTFIX}.pyd
+ COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/unicodedata${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/unicodedata${PYTHON_POSTFIX}.pyd
+ COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/winsound${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/winsound${PYTHON_POSTFIX}.pyd
+ COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_ctypes${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_ctypes${PYTHON_POSTFIX}.pyd
+ COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_ctypes_test${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_ctypes_test${PYTHON_POSTFIX}.pyd
+ COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_decimal${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_decimal${PYTHON_POSTFIX}.pyd
+ COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_elementtree${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_elementtree${PYTHON_POSTFIX}.pyd
+ COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_msi${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_msi${PYTHON_POSTFIX}.pyd
+ COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_multiprocessing${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_multiprocessing${PYTHON_POSTFIX}.pyd
+ COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_overlapped${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_overlapped${PYTHON_POSTFIX}.pyd
+ COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_socket${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_socket${PYTHON_POSTFIX}.pyd
+ COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_testbuffer${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_testbuffer${PYTHON_POSTFIX}.pyd
+ COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_testcapi${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_testcapi${PYTHON_POSTFIX}.pyd
+ COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_testimportmultiple${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_testimportmultiple${PYTHON_POSTFIX}.pyd
+ COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_testmultiphase${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_testmultiphase${PYTHON_POSTFIX}.pyd
+ COMMAND ${CMAKE_COMMAND} -E chdir "${BUILD_DIR}/python/src/external_python/redist" ${CMAKE_COMMAND} -E tar "cfvz" "${LIBDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.tar.gz" "."
+ )
+
+ add_custom_target(Package_Python ALL DEPENDS external_python ${LIBDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.tar.gz ${BUILD_DIR}/python/src/external_python/redist/bin/python${PYTHON_POSTFIX}.exe)
+
+ if(MSVC12)
+ set(PYTHON_DISTUTIL_PATCH ${PATCH_CMD} --verbose -p 0 -d ${BUILD_DIR}/python/src/external_python/run/lib/distutils < ${PATCH_DIR}/python_runtime_vc2013.diff)
+ else()
+ set(PYTHON_DISTUTIL_PATCH echo "No patch needed")
+ endif()
+
+ add_custom_command(OUTPUT ${BUILD_DIR}/python/src/external_python/run/python${PYTHON_POSTFIX}.exe
+ COMMAND ${CMAKE_COMMAND} -E copy_directory ${BUILD_DIR}/python/src/external_python/redist ${BUILD_DIR}/python/src/external_python/run
+ COMMAND ${CMAKE_COMMAND} -E copy_directory ${BUILD_DIR}/python/src/external_python/include ${BUILD_DIR}/python/src/external_python/run/include
+ COMMAND ${CMAKE_COMMAND} -E copy "${BUILD_DIR}/python/src/external_python/PC/pyconfig.h" ${BUILD_DIR}/python/src/external_python/run/include/pyconfig.h
+ COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.dll" ${BUILD_DIR}/python/src/external_python/run/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.dll
+ COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.lib" ${BUILD_DIR}/python/src/external_python/run/libs/python${PYTHON_SHORT_VERSION_NO_DOTS}.lib #missing postfix on purpose, distutils is not expecting it
+ COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.lib" ${BUILD_DIR}/python/src/external_python/run/libs/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.lib #other things like numpy still want it though.
+ COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/python${PYTHON_POSTFIX}.exe" ${BUILD_DIR}/python/src/external_python/run/python${PYTHON_POSTFIX}.exe
+ COMMAND ${BUILD_DIR}/python/src/external_python/run/python${PYTHON_POSTFIX}.exe -m ensurepip --upgrade
+ COMMAND ${PYTHON_DISTUTIL_PATCH}
+ )
+ add_custom_target(Make_Python_Environment ALL DEPENDS ${BUILD_DIR}/python/src/external_python/run/python${PYTHON_POSTFIX}.exe Package_Python)
+endif(MSVC)
diff --git a/build_files/build_environment/cmake/python_site_packages.cmake b/build_files/build_environment/cmake/python_site_packages.cmake
new file mode 100644
index 00000000000..530bae4c958
--- /dev/null
+++ b/build_files/build_environment/cmake/python_site_packages.cmake
@@ -0,0 +1,38 @@
+# ***** 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(WIN32)
+ set(HARVEST_CMD cmd /C FOR /d /r ${BUILD_DIR}/python/src/external_python/run/lib/site-packages %d IN (__pycache__) DO @IF EXIST "%d" rd /s /q "%d" &&
+ ${CMAKE_COMMAND} -E copy_directory ${BUILD_DIR}/python/src/external_python/run/lib/site-packages/idna ${HARVEST_TARGET}/Release/site-packages/idna &&
+ ${CMAKE_COMMAND} -E copy_directory ${BUILD_DIR}/python/src/external_python/run/lib/site-packages/chardet ${HARVEST_TARGET}/Release/site-packages/chardet &&
+ ${CMAKE_COMMAND} -E copy_directory ${BUILD_DIR}/python/src/external_python/run/lib/site-packages/urllib3 ${HARVEST_TARGET}/Release/site-packages/urllib3 &&
+ ${CMAKE_COMMAND} -E copy_directory ${BUILD_DIR}/python/src/external_python/run/lib/site-packages/certifi ${HARVEST_TARGET}/Release/site-packages/certifi &&
+ ${CMAKE_COMMAND} -E copy_directory ${BUILD_DIR}/python/src/external_python/run/lib/site-packages/requests ${HARVEST_TARGET}/Release/site-packages/requests
+ )
+else()
+ set(HARVEST_CMD echo .)
+endif()
+
+ExternalProject_Add(external_python_site_packages
+ DOWNLOAD_COMMAND ""
+ CONFIGURE_COMMAND ""
+ BUILD_COMMAND ""
+ PREFIX ${BUILD_DIR}/site_packages
+ INSTALL_COMMAND ${PYTHON_BINARY} -m pip install idna==${IDNA_VERSION} chardet==${CHARDET_VERSION} urllib3==${URLLIB3_VERSION} certifi==${CERTIFI_VERSION} requests==${REQUESTS_VERSION} --no-binary :all: && ${HARVEST_CMD}
+)
+
+add_dependencies(external_python_site_packages Make_Python_Environment)
diff --git a/build_files/build_environment/cmake/schroedinger.cmake b/build_files/build_environment/cmake/schroedinger.cmake
new file mode 100644
index 00000000000..54a20db5b5e
--- /dev/null
+++ b/build_files/build_environment/cmake/schroedinger.cmake
@@ -0,0 +1,45 @@
+# ***** 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(WIN32)
+ set(SCHROEDINGER_EXTRA_FLAGS "CFLAGS=-g -I./ -I${LIBDIR}/orc/include/orc-0.4" "LDFLAGS=-Wl,--as-needed -static-libgcc -L${LIBDIR}/orc/lib" ORC_CFLAGS=-I${LIBDIR}/orc/include/orc-0.4 ORC_LDFLAGS=-L${LIBDIR}/orc/lib ORC_LIBS=${LIBDIR}/orc/lib/liborc-0.4.a ORCC=${LIBDIR}/orc/bin/orcc.exe)
+else()
+ set(SCHROEDINGER_CFLAGS "${PLATFORM_CFLAGS} -I./ -I${LIBDIR}/orc/include/orc-0.4")
+ set(SCHROEDINGER_LDFLAGS "${PLATFORM_LDFLAGS} -L${LIBDIR}/orc/lib")
+ set(SCHROEDINGER_EXTRA_FLAGS CFLAGS=${SCHROEDINGER_CFLAGS} LDFLAGS=${SCHROEDINGER_LDFLAGS} ORC_CFLAGS=-I${LIBDIR}/orc/include/orc-0.4 ORC_LDFLAGS=-L${LIBDIR}/orc/lib ORCC=${LIBDIR}/orc/bin/orcc) # ORC_LIBS=${LIBDIR}/orc/lib/liborc-0.4.a
+endif()
+
+ExternalProject_Add(external_schroedinger
+ URL ${SCHROEDINGER_URI}
+ DOWNLOAD_DIR ${DOWNLOAD_DIR}
+ URL_HASH SHA256=${SCHROEDINGER_HASH}
+ PREFIX ${BUILD_DIR}/schroedinger
+ PATCH_COMMAND ${PATCH_CMD} --verbose -p 0 -N -d ${BUILD_DIR}/schroedinger/src/external_schroedinger < ${PATCH_DIR}/schroedinger.diff
+ CONFIGURE_COMMAND ${CONFIGURE_ENV} &&
+ cd ${BUILD_DIR}/schroedinger/src/external_schroedinger/ &&
+ ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/schroedinger --disable-shared --enable-static ${SCHROEDINGER_EXTRA_FLAGS}
+ BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/schroedinger/src/external_schroedinger/ && make -j${MAKE_THREADS}
+ INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/schroedinger/src/external_schroedinger/ && make install
+ INSTALL_DIR ${LIBDIR}/schroedinger
+)
+
+add_dependencies(external_schroedinger external_orc)
+
+if(MSVC)
+ set_target_properties(external_schroedinger PROPERTIES FOLDER Mingw)
+endif()
diff --git a/build_files/build_environment/cmake/sdl.cmake b/build_files/build_environment/cmake/sdl.cmake
new file mode 100644
index 00000000000..0fbfa078eb1
--- /dev/null
+++ b/build_files/build_environment/cmake/sdl.cmake
@@ -0,0 +1,39 @@
+# ***** 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(WIN32)
+ set(SDL_EXTRA_ARGS
+ -DSDL_STATIC=Off
+ )
+else()
+ set(SDL_EXTRA_ARGS
+ -DSDL_STATIC=ON
+ -DSDL_SHARED=OFF
+ -DSDL_VIDEO=OFF
+ )
+endif()
+
+ExternalProject_Add(external_sdl
+ URL ${SDL_URI}
+ DOWNLOAD_DIR ${DOWNLOAD_DIR}
+ URL_HASH MD5=${SDL_HASH}
+ PREFIX ${BUILD_DIR}/sdl
+ PATCH_COMMAND ${PATCH_CMD} -p 0 -N -d ${BUILD_DIR}/sdl/src/external_sdl < ${PATCH_DIR}/sdl.diff
+ CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/sdl ${DEFAULT_CMAKE_FLAGS} ${SDL_EXTRA_ARGS}
+ INSTALL_DIR ${LIBDIR}/sdl
+)
diff --git a/build_files/build_environment/cmake/setup_mingw32.cmake b/build_files/build_environment/cmake/setup_mingw32.cmake
new file mode 100644
index 00000000000..f0d99356da0
--- /dev/null
+++ b/build_files/build_environment/cmake/setup_mingw32.cmake
@@ -0,0 +1,219 @@
+# ***** 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 *****
+
+####################################################################################################################
+# Mingw32 Builds
+####################################################################################################################
+# This installs mingw32+msys to compile ffmpeg/iconv/libsndfile/lapack/fftw3
+####################################################################################################################
+
+message("LIBDIR = ${LIBDIR}")
+macro(cmake_to_msys_path MsysPath ResultingPath)
+ string(REPLACE ":" "" TmpPath "${MsysPath}")
+ string(SUBSTRING ${TmpPath} 0 1 Drive)
+ string(SUBSTRING ${TmpPath} 1 255 PathPart)
+ string(TOLOWER ${Drive} LowerDrive)
+ string(CONCAT ${ResultingPath} "/" ${LowerDrive} ${PathPart})
+endmacro()
+cmake_to_msys_path(${LIBDIR} mingw_LIBDIR)
+message("mingw_LIBDIR = ${mingw_LIBDIR}")
+
+message("Checking for mingw32")
+# download mingw32
+if(NOT EXISTS "${DOWNLOAD_DIR}/i686-w64-mingw32-gcc-4.8.0-win32_rubenvb.7z")
+ message("Downloading mingw32")
+ file(DOWNLOAD "https://nchc.dl.sourceforge.net/project/mingw-w64/Toolchains%20targetting%20Win32/Personal%20Builds/rubenvb/gcc-4.8-release/i686-w64-mingw32-gcc-4.8.0-win32_rubenvb.7z" "${DOWNLOAD_DIR}/i686-w64-mingw32-gcc-4.8.0-win32_rubenvb.7z")
+endif()
+
+# make mingw root directory
+if(NOT EXISTS "${DOWNLOAD_DIR}/mingw")
+ execute_process(
+ COMMAND ${CMAKE_COMMAND} -E make_directory ${DOWNLOAD_DIR}/mingw
+ WORKING_DIRECTORY ${DOWNLOAD_DIR}
+ )
+endif()
+
+# extract mingw32
+if((NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw32/mingw32env.cmd") AND (EXISTS "${DOWNLOAD_DIR}/i686-w64-mingw32-gcc-4.8.0-win32_rubenvb.7z"))
+ message("Extracting mingw32")
+ execute_process(
+ COMMAND ${CMAKE_COMMAND} -E tar jxf ${DOWNLOAD_DIR}/i686-w64-mingw32-gcc-4.8.0-win32_rubenvb.7z
+ WORKING_DIRECTORY ${DOWNLOAD_DIR}/mingw
+ )
+endif()
+
+message("Checking for pkg-config")
+if(NOT EXISTS "${DOWNLOAD_DIR}/pkg-config-lite-0.28-1_bin-win32.zip")
+ message("Downloading pkg-config")
+ file(DOWNLOAD "https://nchc.dl.sourceforge.net/project/pkgconfiglite/0.28-1/pkg-config-lite-0.28-1_bin-win32.zip" "${DOWNLOAD_DIR}/pkg-config-lite-0.28-1_bin-win32.zip")
+endif()
+
+# extract pkgconfig
+if((NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw32/bin/pkg-config.exe") AND (EXISTS "${DOWNLOAD_DIR}/pkg-config-lite-0.28-1_bin-win32.zip"))
+ message("Extracting pkg-config")
+ execute_process(
+ COMMAND ${CMAKE_COMMAND} -E tar jxf "${DOWNLOAD_DIR}/pkg-config-lite-0.28-1_bin-win32.zip"
+ WORKING_DIRECTORY ${DOWNLOAD_DIR}/
+ )
+
+ execute_process(
+ COMMAND ${CMAKE_COMMAND} -E copy "${DOWNLOAD_DIR}/pkg-config-lite-0.28-1/bin/pkg-config.exe" "${DOWNLOAD_DIR}/mingw/mingw32/bin/pkg-config.exe"
+ )
+
+endif()
+
+message("Checking for nasm")
+if(NOT EXISTS "${DOWNLOAD_DIR}/nasm-2.12.01-win32.zip")
+ message("Downloading nasm")
+ file(DOWNLOAD "http://www.nasm.us/pub/nasm/releasebuilds/2.12.01/win32/nasm-2.12.01-win32.zip" "${DOWNLOAD_DIR}/nasm-2.12.01-win32.zip")
+endif()
+
+# extract nasm
+if((NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw32/bin/nasm.exe") AND (EXISTS "${DOWNLOAD_DIR}/nasm-2.12.01-win32.zip"))
+ message("Extracting nasm")
+ execute_process(
+ COMMAND ${CMAKE_COMMAND} -E tar jxf "${DOWNLOAD_DIR}/nasm-2.12.01-win32.zip"
+ WORKING_DIRECTORY ${DOWNLOAD_DIR}/
+ )
+ execute_process(
+ COMMAND ${CMAKE_COMMAND} -E copy "${DOWNLOAD_DIR}/nasm-2.12.01/nasm.exe" "${DOWNLOAD_DIR}/mingw/mingw32/bin/nasm.exe"
+ )
+
+endif()
+
+message("Checking for mingwGet")
+if(NOT EXISTS "${DOWNLOAD_DIR}/mingw-get-0.6.2-mingw32-beta-20131004-1-bin.zip")
+ message("Downloading mingw-get")
+ file(DOWNLOAD "https://nchc.dl.sourceforge.net/project/mingw/Installer/mingw-get/mingw-get-0.6.2-beta-20131004-1/mingw-get-0.6.2-mingw32-beta-20131004-1-bin.zip" "${DOWNLOAD_DIR}/mingw-get-0.6.2-mingw32-beta-20131004-1-bin.zip")
+endif()
+
+# extract mingw_get
+if((NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw32/bin/mingw-get.exe") AND (EXISTS "${DOWNLOAD_DIR}/mingw-get-0.6.2-mingw32-beta-20131004-1-bin.zip"))
+ message("Extracting mingw-get")
+ execute_process(
+ COMMAND ${CMAKE_COMMAND} -E tar jxf "${DOWNLOAD_DIR}/mingw-get-0.6.2-mingw32-beta-20131004-1-bin.zip"
+ WORKING_DIRECTORY ${DOWNLOAD_DIR}/mingw/mingw32/
+ )
+endif()
+
+if((EXISTS "${DOWNLOAD_DIR}/mingw/mingw32/bin/mingw-get.exe") AND (NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw32/msys/1.0/bin/make.exe"))
+ message("Installing MSYS")
+ execute_process(
+ COMMAND ${DOWNLOAD_DIR}/mingw/mingw32/bin/mingw-get install msys msys-patch
+ WORKING_DIRECTORY ${DOWNLOAD_DIR}/mingw/mingw32/bin/
+ )
+endif()
+
+message("Checking for CoreUtils")
+# download old core_utils for pr.exe (ffmpeg needs it to build)
+if(NOT EXISTS "${DOWNLOAD_DIR}/coreutils-5.97-MSYS-1.0.11-snapshot.tar.bz2")
+ message("Downloading CoreUtils 5.97")
+ file(DOWNLOAD "https://nchc.dl.sourceforge.net/project/mingw/MSYS/Base/msys-core/_obsolete/coreutils-5.97-MSYS-1.0.11-2/coreutils-5.97-MSYS-1.0.11-snapshot.tar.bz2" "${DOWNLOAD_DIR}/coreutils-5.97-MSYS-1.0.11-snapshot.tar.bz2")
+endif()
+
+if((EXISTS "${DOWNLOAD_DIR}/coreutils-5.97-MSYS-1.0.11-snapshot.tar.bz2") AND (NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw32/msys/1.0/bin/pr.exe"))
+ message("Installing pr from CoreUtils 5.97")
+ execute_process(
+ COMMAND ${CMAKE_COMMAND} -E make_directory ${DOWNLOAD_DIR}/tmp_coreutils
+ WORKING_DIRECTORY ${DOWNLOAD_DIR}
+ )
+
+ execute_process(
+ COMMAND ${CMAKE_COMMAND} -E tar jxf ${DOWNLOAD_DIR}/coreutils-5.97-MSYS-1.0.11-snapshot.tar.bz2
+ WORKING_DIRECTORY ${DOWNLOAD_DIR}/tmp_coreutils/
+ )
+
+ execute_process(
+ COMMAND ${CMAKE_COMMAND} -E copy ${DOWNLOAD_DIR}/tmp_coreutils/coreutils-5.97/bin/pr.exe "${DOWNLOAD_DIR}/mingw/mingw32/msys/1.0/bin/pr.exe"
+ WORKING_DIRECTORY ${DOWNLOAD_DIR}/tmp_coreutils/
+ )
+endif()
+
+if(NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw32/ming32sh.cmd")
+ message("Installing ming32sh.cmd")
+ execute_process(
+ COMMAND ${CMAKE_COMMAND} -E copy ${PATCH_DIR}/ming32sh.cmd ${DOWNLOAD_DIR}/mingw/mingw32/ming32sh.cmd
+ )
+endif()
+
+message("Checking for perl")
+# download perl for libvpx
+if(NOT EXISTS "${DOWNLOAD_DIR}/strawberry-perl-5.22.1.3-32bit-portable.zip")
+ message("Downloading perl")
+ file(DOWNLOAD "http://strawberryperl.com/download/5.22.1.3/strawberry-perl-5.22.1.3-32bit-portable.zip" "${DOWNLOAD_DIR}/strawberry-perl-5.22.1.3-32bit-portable.zip")
+endif()
+
+# make perl root directory
+if(NOT EXISTS "${DOWNLOAD_DIR}/perl32")
+ execute_process(
+ COMMAND ${CMAKE_COMMAND} -E make_directory ${DOWNLOAD_DIR}/perl32
+ WORKING_DIRECTORY ${DOWNLOAD_DIR}
+ )
+endif()
+
+# extract perl
+if((NOT EXISTS "${DOWNLOAD_DIR}/perl32/portable.perl") AND (EXISTS "${DOWNLOAD_DIR}/strawberry-perl-5.22.1.3-32bit-portable.zip"))
+ message("Extracting perl")
+ execute_process(
+ COMMAND ${CMAKE_COMMAND} -E tar jxf ${DOWNLOAD_DIR}/strawberry-perl-5.22.1.3-32bit-portable.zip
+ WORKING_DIRECTORY ${DOWNLOAD_DIR}/perl32
+ )
+endif()
+
+# get yasm for vpx
+if(NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw32/bin/yasm.exe")
+ message("Downloading yasm")
+ file(DOWNLOAD "http://www.tortall.net/projects/yasm/releases/yasm-1.3.0-win32.exe" "${DOWNLOAD_DIR}/mingw/mingw32/bin/yasm.exe")
+endif()
+
+message("checking i686-w64-mingw32-strings")
+# copy strings.exe to i686-w64-mingw32-strings for x264
+if(NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw32/bin/i686-w64-mingw32-strings.exe")
+ message("fixing i686-w64-mingw32-strings.exe")
+ execute_process(
+ COMMAND ${CMAKE_COMMAND} -E copy "${DOWNLOAD_DIR}/mingw/mingw32/bin/strings.exe" "${DOWNLOAD_DIR}/mingw/mingw32/bin/i686-w64-mingw32-strings.exe"
+ )
+endif()
+
+message("checking i686-w64-mingw32-ar.exe")
+# copy ar.exe to i686-w64-mingw32-ar.exe for x264
+if(NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw32/bin/i686-w64-mingw32-ar.exe")
+ message("fixing i686-w64-mingw32-ar.exe")
+ execute_process(
+ COMMAND ${CMAKE_COMMAND} -E copy "${DOWNLOAD_DIR}/mingw/mingw32/bin/ar.exe" "${DOWNLOAD_DIR}/mingw/mingw32/bin/i686-w64-mingw32-ar.exe"
+ )
+endif()
+
+message("checking i686-w64-mingw32-strip.exe")
+# copy strip.exe to i686-w64-mingw32-strip.exe for x264
+if(NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw32/bin/i686-w64-mingw32-strip.exe")
+ message("fixing i686-w64-mingw32-strip.exe")
+ execute_process(
+ COMMAND ${CMAKE_COMMAND} -E copy "${DOWNLOAD_DIR}/mingw/mingw32/bin/strip.exe" "${DOWNLOAD_DIR}/mingw/mingw32/bin/i686-w64-mingw32-strip.exe"
+ )
+endif()
+
+message("checking i686-w64-mingw32-ranlib.exe")
+# copy ranlib.exe to i686-w64-mingw32-ranlib.exe for x264
+if(NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw32/bin/i686-w64-mingw32-ranlib.exe")
+ message("fixing i686-w64-mingw32-ranlib.exe")
+ execute_process(
+ COMMAND ${CMAKE_COMMAND} -E copy "${DOWNLOAD_DIR}/mingw/mingw32/bin/ranlib.exe" "${DOWNLOAD_DIR}/mingw/mingw32/bin/i686-w64-mingw32-ranlib.exe"
+ )
+endif()
+
diff --git a/build_files/build_environment/cmake/setup_mingw64.cmake b/build_files/build_environment/cmake/setup_mingw64.cmake
new file mode 100644
index 00000000000..14f75d410b4
--- /dev/null
+++ b/build_files/build_environment/cmake/setup_mingw64.cmake
@@ -0,0 +1,219 @@
+# ***** 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 *****
+
+####################################################################################################################
+# Mingw64 Builds
+####################################################################################################################
+# This installs mingw64+msys to compile ffmpeg/iconv/libsndfile/lapack/fftw3
+####################################################################################################################
+
+message("LIBDIR = ${LIBDIR}")
+macro(cmake_to_msys_path MsysPath ResultingPath)
+ string(REPLACE ":" "" TmpPath "${MsysPath}")
+ string(SUBSTRING ${TmpPath} 0 1 Drive)
+ string(SUBSTRING ${TmpPath} 1 255 PathPart)
+ string(TOLOWER ${Drive} LowerDrive)
+ string(CONCAT ${ResultingPath} "/" ${LowerDrive} ${PathPart})
+endmacro()
+cmake_to_msys_path(${LIBDIR} mingw_LIBDIR)
+message("mingw_LIBDIR = ${mingw_LIBDIR}")
+
+message("Checking for mingw64")
+# download ming64
+if(NOT EXISTS "${DOWNLOAD_DIR}/x86_64-w64-mingw32-gcc-4.8.0-win64_rubenvb.7z")
+ message("Downloading mingw64")
+ file(DOWNLOAD "https://nchc.dl.sourceforge.net/project/mingw-w64/Toolchains%20targetting%20Win64/Personal%20Builds/rubenvb/gcc-4.8-release/x86_64-w64-mingw32-gcc-4.8.0-win64_rubenvb.7z" "${DOWNLOAD_DIR}/x86_64-w64-mingw32-gcc-4.8.0-win64_rubenvb.7z")
+endif()
+
+# make mingw root directory
+if(NOT EXISTS "${DOWNLOAD_DIR}/mingw")
+ execute_process(
+ COMMAND ${CMAKE_COMMAND} -E make_directory ${DOWNLOAD_DIR}/mingw
+ WORKING_DIRECTORY ${DOWNLOAD_DIR}
+ )
+endif()
+
+# extract mingw64
+if((NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw64/mingw64env.cmd") AND (EXISTS "${DOWNLOAD_DIR}/x86_64-w64-mingw32-gcc-4.8.0-win64_rubenvb.7z"))
+ message("Extracting mingw64")
+ execute_process(
+ COMMAND ${CMAKE_COMMAND} -E tar jxf ${DOWNLOAD_DIR}/x86_64-w64-mingw32-gcc-4.8.0-win64_rubenvb.7z
+ WORKING_DIRECTORY ${DOWNLOAD_DIR}/mingw
+ )
+endif()
+
+message("Checking for pkg-config")
+if(NOT EXISTS "${DOWNLOAD_DIR}/pkg-config-lite-0.28-1_bin-win32.zip")
+ message("Downloading pkg-config")
+ file(DOWNLOAD "https://nchc.dl.sourceforge.net/project/pkgconfiglite/0.28-1/pkg-config-lite-0.28-1_bin-win32.zip" "${DOWNLOAD_DIR}/pkg-config-lite-0.28-1_bin-win32.zip")
+endif()
+
+# extract pkgconfig
+if((NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw64/bin/pkg-config.exe") AND (EXISTS "${DOWNLOAD_DIR}/pkg-config-lite-0.28-1_bin-win32.zip"))
+ message("Extracting pkg-config")
+ execute_process(
+ COMMAND ${CMAKE_COMMAND} -E tar jxf "${DOWNLOAD_DIR}/pkg-config-lite-0.28-1_bin-win32.zip"
+ WORKING_DIRECTORY ${DOWNLOAD_DIR}/
+ )
+
+ execute_process(
+ COMMAND ${CMAKE_COMMAND} -E copy "${DOWNLOAD_DIR}/pkg-config-lite-0.28-1/bin/pkg-config.exe" "${DOWNLOAD_DIR}/mingw/mingw64/bin/pkg-config.exe"
+ )
+
+endif()
+
+message("Checking for nasm")
+if(NOT EXISTS "${DOWNLOAD_DIR}/nasm-2.12.01-win64.zip")
+ message("Downloading nasm")
+ file(DOWNLOAD "http://www.nasm.us/pub/nasm/releasebuilds/2.12.01/win64/nasm-2.12.01-win64.zip" "${DOWNLOAD_DIR}/nasm-2.12.01-win64.zip")
+endif()
+
+# extract nasm
+if((NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw64/bin/nasm.exe") AND (EXISTS "${DOWNLOAD_DIR}/nasm-2.12.01-win64.zip"))
+ message("Extracting nasm")
+ execute_process(
+ COMMAND ${CMAKE_COMMAND} -E tar jxf "${DOWNLOAD_DIR}/nasm-2.12.01-win64.zip"
+ WORKING_DIRECTORY ${DOWNLOAD_DIR}/
+ )
+ execute_process(
+ COMMAND ${CMAKE_COMMAND} -E copy "${DOWNLOAD_DIR}/nasm-2.12.01/nasm.exe" "${DOWNLOAD_DIR}/mingw/mingw64/bin/nasm.exe"
+ )
+
+endif()
+
+message("Checking for mingwGet")
+if(NOT EXISTS "${DOWNLOAD_DIR}/mingw-get-0.6.2-mingw32-beta-20131004-1-bin.zip")
+ message("Downloading mingw-get")
+ file(DOWNLOAD "https://nchc.dl.sourceforge.net/project/mingw/Installer/mingw-get/mingw-get-0.6.2-beta-20131004-1/mingw-get-0.6.2-mingw32-beta-20131004-1-bin.zip" "${DOWNLOAD_DIR}/mingw-get-0.6.2-mingw32-beta-20131004-1-bin.zip")
+endif()
+
+# extract mingw_get
+if((NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw64/bin/mingw-get.exe") AND (EXISTS "${DOWNLOAD_DIR}/mingw-get-0.6.2-mingw32-beta-20131004-1-bin.zip"))
+ message("Extracting mingw-get")
+ execute_process(
+ COMMAND ${CMAKE_COMMAND} -E tar jxf "${DOWNLOAD_DIR}/mingw-get-0.6.2-mingw32-beta-20131004-1-bin.zip"
+ WORKING_DIRECTORY ${DOWNLOAD_DIR}/mingw/mingw64/
+ )
+endif()
+
+if((EXISTS "${DOWNLOAD_DIR}/mingw/mingw64/bin/mingw-get.exe") AND (NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw64/msys/1.0/bin/make.exe"))
+ message("Installing MSYS")
+ execute_process(
+ COMMAND ${DOWNLOAD_DIR}/mingw/mingw64/bin/mingw-get install msys msys-patch
+ WORKING_DIRECTORY ${DOWNLOAD_DIR}/mingw/mingw64/bin/
+ )
+endif()
+
+message("Checking for CoreUtils")
+# download old core_utils for pr.exe (ffmpeg needs it to build)
+if(NOT EXISTS "${DOWNLOAD_DIR}/coreutils-5.97-MSYS-1.0.11-snapshot.tar.bz2")
+ message("Downloading CoreUtils 5.97")
+ file(DOWNLOAD "https://nchc.dl.sourceforge.net/project/mingw/MSYS/Base/msys-core/_obsolete/coreutils-5.97-MSYS-1.0.11-2/coreutils-5.97-MSYS-1.0.11-snapshot.tar.bz2" "${DOWNLOAD_DIR}/coreutils-5.97-MSYS-1.0.11-snapshot.tar.bz2")
+endif()
+
+if((EXISTS "${DOWNLOAD_DIR}/coreutils-5.97-MSYS-1.0.11-snapshot.tar.bz2") AND (NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw64/msys/1.0/bin/pr.exe"))
+ message("Installing pr from CoreUtils 5.97")
+ execute_process(
+ COMMAND ${CMAKE_COMMAND} -E make_directory ${DOWNLOAD_DIR}/tmp_coreutils
+ WORKING_DIRECTORY ${DOWNLOAD_DIR}
+ )
+
+ execute_process(
+ COMMAND ${CMAKE_COMMAND} -E tar jxf ${DOWNLOAD_DIR}/coreutils-5.97-MSYS-1.0.11-snapshot.tar.bz2
+ WORKING_DIRECTORY ${DOWNLOAD_DIR}/tmp_coreutils/
+ )
+
+ execute_process(
+ COMMAND ${CMAKE_COMMAND} -E copy ${DOWNLOAD_DIR}/tmp_coreutils/coreutils-5.97/bin/pr.exe "${DOWNLOAD_DIR}/mingw/mingw64/msys/1.0/bin/pr.exe"
+ WORKING_DIRECTORY ${DOWNLOAD_DIR}/tmp_coreutils/
+ )
+endif()
+
+if(NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw64/ming64sh.cmd")
+ message("Installing ming64sh.cmd")
+ execute_process(
+ COMMAND ${CMAKE_COMMAND} -E copy ${PATCH_DIR}/ming64sh.cmd ${DOWNLOAD_DIR}/mingw/mingw64/ming64sh.cmd
+ )
+endif()
+
+message("Checking for perl")
+# download perl for libvpx
+if(NOT EXISTS "${DOWNLOAD_DIR}/strawberry-perl-5.22.1.3-64bit-portable.zip")
+ message("Downloading perl")
+ file(DOWNLOAD "http://strawberryperl.com/download/5.22.1.3/strawberry-perl-5.22.1.3-64bit-portable.zip" "${DOWNLOAD_DIR}/strawberry-perl-5.22.1.3-64bit-portable.zip")
+endif()
+
+# make perl root directory
+if(NOT EXISTS "${DOWNLOAD_DIR}/perl")
+ execute_process(
+ COMMAND ${CMAKE_COMMAND} -E make_directory ${DOWNLOAD_DIR}/perl
+ WORKING_DIRECTORY ${DOWNLOAD_DIR}
+ )
+endif()
+
+# extract perl
+if((NOT EXISTS "${DOWNLOAD_DIR}/perl/portable.perl") AND (EXISTS "${DOWNLOAD_DIR}/strawberry-perl-5.22.1.3-64bit-portable.zip"))
+ message("Extracting perl")
+ execute_process(
+ COMMAND ${CMAKE_COMMAND} -E tar jxf ${DOWNLOAD_DIR}/strawberry-perl-5.22.1.3-64bit-portable.zip
+ WORKING_DIRECTORY ${DOWNLOAD_DIR}/perl
+ )
+endif()
+
+# get yasm for vpx
+if(NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw64/bin/yasm.exe")
+ message("Downloading yasm")
+ file(DOWNLOAD "http://www.tortall.net/projects/yasm/releases/yasm-1.3.0-win64.exe" "${DOWNLOAD_DIR}/mingw/mingw64/bin/yasm.exe")
+endif()
+
+message("checking x86_64-w64-mingw32-strings.exe")
+# copy strings.exe to x86_64-w64-mingw32-strings.exe for x264
+if(NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw64/bin/x86_64-w64-mingw32-strings.exe")
+ message("fixing x86_64-w64-mingw32-strings.exe")
+ execute_process(
+ COMMAND ${CMAKE_COMMAND} -E copy "${DOWNLOAD_DIR}/mingw/mingw64/bin/strings.exe" "${DOWNLOAD_DIR}/mingw/mingw64/bin/x86_64-w64-mingw32-strings.exe"
+ )
+endif()
+
+message("checking x86_64-w64-mingw32-ar.exe")
+# copy ar.exe to x86_64-w64-mingw32-ar.exe for x264
+if(NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw64/bin/x86_64-w64-mingw32-ar.exe")
+ message("fixing x86_64-w64-mingw32-ar.exe")
+ execute_process(
+ COMMAND ${CMAKE_COMMAND} -E copy "${DOWNLOAD_DIR}/mingw/mingw64/bin/ar.exe" "${DOWNLOAD_DIR}/mingw/mingw64/bin/x86_64-w64-mingw32-ar.exe"
+ )
+endif()
+
+message("checking x86_64-w64-mingw32-strip.exe")
+# copy strip.exe to x86_64-w64-mingw32-strip.exe for x264
+if(NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw64/bin/x86_64-w64-mingw32-strip.exe")
+ message("fixing x86_64-w64-mingw32-strip.exe")
+ execute_process(
+ COMMAND ${CMAKE_COMMAND} -E copy "${DOWNLOAD_DIR}/mingw/mingw64/bin/strip.exe" "${DOWNLOAD_DIR}/mingw/mingw64/bin/x86_64-w64-mingw32-strip.exe"
+ )
+endif()
+
+message("checking x86_64-w64-mingw32-ranlib.exe")
+# copy ranlib.exe to x86_64-w64-mingw32-ranlib.exe for x264
+if(NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw64/bin/x86_64-w64-mingw32-ranlib.exe")
+ message("fixing x86_64-w64-mingw32-ranlib.exe")
+ execute_process(
+ COMMAND ${CMAKE_COMMAND} -E copy "${DOWNLOAD_DIR}/mingw/mingw64/bin/ranlib.exe" "${DOWNLOAD_DIR}/mingw/mingw64/bin/x86_64-w64-mingw32-ranlib.exe"
+ )
+endif()
+
diff --git a/build_files/build_environment/cmake/sndfile.cmake b/build_files/build_environment/cmake/sndfile.cmake
new file mode 100644
index 00000000000..ce10f07c133
--- /dev/null
+++ b/build_files/build_environment/cmake/sndfile.cmake
@@ -0,0 +1,55 @@
+# ***** 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(SNDFILE_EXTRA_ARGS)
+set(SNDFILE_ENV PKG_CONFIG_PATH=${mingw_LIBDIR}/ogg/lib/pkgconfig:${mingw_LIBDIR}/vorbis/lib/pkgconfig:${mingw_LIBDIR}/flac/lib/pkgconfig:${mingw_LIBDIR})
+
+if(WIN32)
+ set(SNDFILE_ENV set ${SNDFILE_ENV} &&)
+ #shared for windows because static libs will drag in a libgcc dependency.
+ set(SNDFILE_OPTIONS --disable-static --enable-shared )
+else()
+ set(SNDFILE_OPTIONS --enable-static --disable-shared )
+endif()
+
+if(APPLE)
+ set(SNDFILE_PATCH_CMD ${PATCH_CMD} --verbose -p 0 -d ${BUILD_DIR}/sndfile/src/external_sndfile < ${PATCH_DIR}/sndfile.diff)
+else()
+ set(SNDFILE_PATCH_CMD)
+endif()
+
+ExternalProject_Add(external_sndfile
+ URL ${SNDFILE_URI}
+ DOWNLOAD_DIR ${DOWNLOAD_DIR}
+ URL_HASH MD5=${SNDFILE_HASH}
+ PREFIX ${BUILD_DIR}/sndfile
+ PATCH_COMMAND ${SNDFILE_PATCH_CMD}
+ CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/sndfile/src/external_sndfile/ && ${SNDFILE_ENV} ${CONFIGURE_COMMAND} ${SNDFILE_OPTIONS} --prefix=${mingw_LIBDIR}/sndfile
+ BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/sndfile/src/external_sndfile/ && make -j${MAKE_THREADS}
+ INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/sndfile/src/external_sndfile/ && make install
+ INSTALL_DIR ${LIBDIR}/sndfile
+)
+
+if(MSVC)
+ set_target_properties(external_sndfile PROPERTIES FOLDER Mingw)
+endif()
+
+add_dependencies(external_sndfile external_ogg external_vorbis)
+if(UNIX)
+ add_dependencies(external_sndfile external_flac)
+endif()
diff --git a/build_files/build_environment/cmake/spnav.cmake b/build_files/build_environment/cmake/spnav.cmake
new file mode 100644
index 00000000000..0dec9799715
--- /dev/null
+++ b/build_files/build_environment/cmake/spnav.cmake
@@ -0,0 +1,28 @@
+# ***** 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 *****
+
+ExternalProject_Add(external_spnav
+ URL ${SPNAV_URI}
+ DOWNLOAD_DIR ${DOWNLOAD_DIR}
+ URL_HASH MD5=${SPNAV_HASH}
+ PREFIX ${BUILD_DIR}/spnav
+ CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/spnav/src/external_spnav/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/spnav --disable-shared --enable-static --with-pic
+ BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/spnav/src/external_spnav/ && make -j${MAKE_THREADS}
+ INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/spnav/src/external_spnav/ && make install
+ INSTALL_DIR ${LIBDIR}/spnav
+)
diff --git a/build_files/build_environment/cmake/tbb.cmake b/build_files/build_environment/cmake/tbb.cmake
new file mode 100644
index 00000000000..c4055d55648
--- /dev/null
+++ b/build_files/build_environment/cmake/tbb.cmake
@@ -0,0 +1,36 @@
+# ***** 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(TBB_EXTRA_ARGS
+ -DTBB_BUILD_SHARED=Off
+ -DTBB_BUILD_TBBMALLOC=Off
+ -DTBB_BUILD_TBBMALLOC_PROXY=Off
+ -DTBB_BUILD_STATIC=On
+)
+
+# CMake script for TBB from https://github.com/wjakob/tbb/blob/master/CMakeLists.txt
+ExternalProject_Add(external_tbb
+ URL ${TBB_URI}
+ DOWNLOAD_DIR ${DOWNLOAD_DIR}
+ URL_HASH MD5=${TBB_HASH}
+ PREFIX ${BUILD_DIR}/tbb
+ PATCH_COMMAND COMMAND ${CMAKE_COMMAND} -E copy ${PATCH_DIR}/cmakelists_tbb.txt ${BUILD_DIR}/tbb/src/external_tbb/CMakeLists.txt &&
+ ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/tbb/src/external_tbb/build/vs2010/version_string.ver ${BUILD_DIR}/tbb/src/external_tbb/src/tbb/version_string.ver
+ CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/tbb ${DEFAULT_CMAKE_FLAGS} ${TBB_EXTRA_ARGS}
+ INSTALL_DIR ${LIBDIR}/tbb
+)
diff --git a/build_files/build_environment/cmake/theora.cmake b/build_files/build_environment/cmake/theora.cmake
new file mode 100644
index 00000000000..03aad42f2db
--- /dev/null
+++ b/build_files/build_environment/cmake/theora.cmake
@@ -0,0 +1,40 @@
+# ***** 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 *****
+
+ExternalProject_Add(external_theora
+ URL ${THEORA_URI}
+ DOWNLOAD_DIR ${DOWNLOAD_DIR}
+ URL_HASH SHA256=${THEORA_HASH}
+ PREFIX ${BUILD_DIR}/theora
+ CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/theora/src/external_theora/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/theora
+ --disable-shared
+ --enable-static
+ --with-pic
+ --with-ogg=${LIBDIR}/ogg
+ --with-vorbis=${LIBDIR}/vorbis
+ --disable-examples
+ BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/theora/src/external_theora/ && make -j${MAKE_THREADS}
+ INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/theora/src/external_theora/ && make install
+ INSTALL_DIR ${LIBDIR}/theora
+)
+
+add_dependencies(external_theora external_vorbis external_ogg)
+
+if(MSVC)
+ set_target_properties(external_theora PROPERTIES FOLDER Mingw)
+endif()
diff --git a/build_files/build_environment/cmake/tiff.cmake b/build_files/build_environment/cmake/tiff.cmake
new file mode 100644
index 00000000000..2c01341eb21
--- /dev/null
+++ b/build_files/build_environment/cmake/tiff.cmake
@@ -0,0 +1,44 @@
+# ***** 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(TIFF_EXTRA_ARGS
+ -DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
+ -DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include
+ -DPNG_STATIC=ON
+ -DBUILD_SHARED_LIBS=OFF
+ -Dlzma=OFF
+ -Djbig=OFF
+)
+
+ExternalProject_Add(external_tiff
+ URL ${TIFF_URI}
+ DOWNLOAD_DIR ${DOWNLOAD_DIR}
+ URL_HASH MD5=${TIFF_HASH}
+ PREFIX ${BUILD_DIR}/tiff
+ CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/tiff ${DEFAULT_CMAKE_FLAGS} ${TIFF_EXTRA_ARGS}
+ INSTALL_DIR ${LIBDIR}/tiff
+)
+
+add_dependencies(external_tiff external_zlib)
+
+if(BUILD_MODE STREQUAL Debug)
+ ExternalProject_Add_Step(external_tiff after_install
+ COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tiff/lib/tiffd${LIBEXT} ${LIBDIR}/tiff/lib/tiff${LIBEXT}
+ DEPENDEES install
+ )
+endif()
diff --git a/build_files/build_environment/cmake/versions.cmake b/build_files/build_environment/cmake/versions.cmake
new file mode 100644
index 00000000000..e53beeddf4a
--- /dev/null
+++ b/build_files/build_environment/cmake/versions.cmake
@@ -0,0 +1,250 @@
+# ***** 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(ZLIB_VERSION 1.2.8)
+set(ZLIB_URI https://netcologne.dl.sourceforge.net/project/libpng/zlib/${ZLIB_VERSION}/zlib-${ZLIB_VERSION}.tar.gz)
+set(ZLIB_HASH 44d667c142d7cda120332623eab69f40)
+
+set(OPENAL_VERSION 1.17.2)
+set(OPENAL_URI http://kcat.strangesoft.net/openal-releases/openal-soft-${OPENAL_VERSION}.tar.bz2)
+set(OPENAL_HASH 1764e0d8fec499589b47ebc724e0913d)
+
+set(PNG_VERSION 1.6.21)
+set(PNG_URI http://prdownloads.sourceforge.net/libpng/libpng-${PNG_VERSION}.tar.gz)
+set(PNG_HASH aca36ec8e0a3b406a5912243bc243717)
+
+set(JPEG_VERSION 1.4.2)
+set(JPEG_URI https://github.com/libjpeg-turbo/libjpeg-turbo/archive/${JPEG_VERSION}.tar.gz)
+set(JPEG_HASH f9804884c1c41eb7f4febb9353a2cb27)
+
+set(BOOST_VERSION 1.60.0)
+set(BOOST_VERSION_NODOTS 1_60_0)
+set(BOOST_URI http://sourceforge.net/projects/boost/files/boost/${BOOST_VERSION}/boost_${BOOST_VERSION_NODOTS}.tar.bz2/download)
+set(BOOST_MD5 65a840e1a0b13a558ff19eeb2c4f0cbe)
+
+set(BLOSC_VERSION 1.7.1)
+set(BLOSC_URI https://github.com/Blosc/c-blosc/archive/v${BLOSC_VERSION}.zip)
+set(BLOSC_HASH ff5cc729a5a25934ef714217218eed26)
+
+set(PTHREADS_VERSION 2-9-1)
+set(PTHREADS_URI ftp://sourceware.org/pub/pthreads-win32/pthreads-w32-${PTHREADS_VERSION}-release.tar.gz)
+set(PTHREADS_SHA512 9c06e85310766834370c3dceb83faafd397da18a32411ca7645c8eb6b9495fea54ca2872f4a3e8d83cb5fdc5dea7f3f0464be5bb9af3222a6534574a184bd551)
+
+set(ILMBASE_VERSION 2.2.0)
+set(ILMBASE_URI http://download.savannah.nongnu.org/releases/openexr/ilmbase-${ILMBASE_VERSION}.tar.gz)
+set(ILMBASE_HASH b540db502c5fa42078249f43d18a4652)
+
+set(OPENEXR_VERSION 2.2.0)
+set(OPENEXR_URI http://download.savannah.nongnu.org/releases/openexr/openexr-2.2.0.tar.gz)
+set(OPENEXR_HASH b64e931c82aa3790329c21418373db4e)
+
+set(FREETYPE_VERSION 263)
+set(FREETYPE_URI http://download.savannah.gnu.org/releases/freetype/ft${FREETYPE_VERSION}.zip)
+set(FREETYPE_HASH 0db2a43301572e5c2b4a0864f237aeeb)
+
+set(GLEW_VERSION 1.13.0)
+set(GLEW_URI http://prdownloads.sourceforge.net/glew/glew/${GLEW_VERSION}/glew-${GLEW_VERSION}.tgz)
+set(GLEW_HASH 7cbada3166d2aadfc4169c4283701066)
+
+set(FREEGLUT_VERSION 3.0.0)
+set(FREEGLUT_URI http://pilotfiber.dl.sourceforge.net/project/freeglut/freeglut/${FREEGLUT_VERSION}/freeglut-${FREEGLUT_VERSION}.tar.gz)
+set(FREEGLUT_HASH 90c3ca4dd9d51cf32276bc5344ec9754)
+
+set(HDF5_VERSION 1.8.17)
+set(HDF5_URI https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8/hdf5-${HDF5_VERSION}/src/hdf5-${HDF5_VERSION}.tar.gz)
+set(HDF5_HASH 7d572f8f3b798a628b8245af0391a0ca)
+
+set(ALEMBIC_VERSION 1.7.1)
+set(ALEMBIC_URI https://github.com/alembic/alembic/archive/${ALEMBIC_VERSION}.zip)
+set(ALEMBIC_MD5 cf7705055501d5ea0cb8256866496f79)
+
+## hash is for 3.1.2
+set(GLFW_GIT_UID 30306e54705c3adae9fe082c816a3be71963485c)
+set(GLFW_URI https://github.com/glfw/glfw/archive/${GLFW_GIT_UID}.zip)
+set(GLFW_HASH 20cacb1613da7eeb092f3ac4f6b2b3d0)
+
+#latest uid in git as of 2016-04-01
+set(CLEW_GIT_UID 277db43f6cafe8b27c6f1055f69dc67da4aeb299)
+set(CLEW_URI https://github.com/OpenCLWrangler/clew/archive/${CLEW_GIT_UID}.zip)
+set(CLEW_HASH 2c699d10ed78362e71f56fae2a4c5f98)
+
+#latest uid in git as of 2016-04-01
+set(CUEW_GIT_UID 1744972026de9cf27c8a7dc39cf39cd83d5f922f)
+set(CUEW_URI https://github.com/CudaWrangler/cuew/archive/${CUEW_GIT_UID}.zip)
+set(CUEW_HASH 86760d62978ebfd96cd93f5aa1abaf4a)
+
+set(OPENSUBDIV_VERSION v3_1_1)
+set(OPENSUBDIV_Hash 25a9a6a94136b0eb85ce69e9c8cb6ab3)
+set(OPENSUBDIV_URI https://github.com/PixarAnimationStudios/OpenSubdiv/archive/${OPENSUBDIV_VERSION}.zip)
+
+set(SDL_VERSION 2.0.4)
+set(SDL_URI https://www.libsdl.org/release/SDL2-${SDL_VERSION}.tar.gz)
+set(SDL_HASH 44fc4a023349933e7f5d7a582f7b886e)
+
+set(OPENCOLLADA_VERSION v1.6.51)
+set(OPENCOLLADA_URI https://github.com/KhronosGroup/OpenCOLLADA/archive/${OPENCOLLADA_VERSION}.tar.gz)
+set(OPENCOLLADA_HASH 23db5087faed4bc4cc1dfe456c0d4701)
+
+set(OPENCOLORIO_URI https://github.com/imageworks/OpenColorIO/archive/6de971097c7f552300f669ed69ca0b6cf5a70843.zip)
+set(OPENCOLORIO_HASH c9de0fd98f26ce6f2e08d617ca68b8e4)
+
+set(LLVM_VERSION 3.4.2)
+set(LLVM_URI http://llvm.org/releases/${LLVM_VERSION}/llvm-${LLVM_VERSION}.src.tar.gz)
+set(LLVM_HASH a20669f75967440de949ac3b1bad439c)
+
+set(CLANG_URI http://llvm.org/releases/${LLVM_VERSION}/cfe-${LLVM_VERSION}.src.tar.gz)
+set(CLANG_HASH 87945973b7c73038871c5f849a818588)
+
+set(OPENIMAGEIO_VERSION 1.7.15)
+set(OPENIMAGEIO_URI https://github.com/OpenImageIO/oiio/archive/Release-${OPENIMAGEIO_VERSION}.zip)
+set(OPENIMAGEIO_HASH_178 e156e3669af0e1373142ab5e8f13de66)
+set(OPENIMAGEIO_HASH_179 4121cb0e0433bda6a7ef32c8628a149f)
+set(OPENIMAGEIO_HASH_1713 42a662775b834161ba88c6abdb299360)
+set(OPENIMAGEIO_HASH_1715 e2ece0f62c013d64c478f82265988b0b)
+set(OPENIMAGEIO_HASH ${OPENIMAGEIO_HASH_1715})
+
+
+set(TIFF_VERSION 4.0.6)
+set(TIFF_URI http://download.osgeo.org/libtiff/tiff-${TIFF_VERSION}.tar.gz)
+set(TIFF_HASH d1d2e940dea0b5ad435f21f03d96dd72)
+
+set(FLEXBISON_VERSION 2.5.5)
+set(FLEXBISON_URI http://prdownloads.sourceforge.net/winflexbison//win_flex_bison-2.5.5.zip)
+set(FLEXBISON_HASH d87a3938194520d904013abef3df10ce)
+
+set(OSL_VERSION 1.7.5)
+set(OSL_URI https://github.com/imageworks/OpenShadingLanguage/archive/Release-${OSL_VERSION}.zip)
+set(OSL_HASH 6924dd5d453159e7b6eb106a08c358cf)
+
+set(PYTHON_VERSION 3.6.2)
+set(PYTHON_SHORT_VERSION 3.6)
+set(PYTHON_SHORT_VERSION_NO_DOTS 36)
+set(PYTHON_URI https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tar.xz)
+set(PYTHON_HASH 2c68846471994897278364fc18730dd9)
+
+set(TBB_VERSION 44_20160128)
+set(TBB_URI https://www.threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb${TBB_VERSION}oss_src_0.tgz)
+set(TBB_HASH 9d8a4cdf43496f1b3f7c473a5248e5cc)
+
+set(OPENVDB_VERSION 3.1.0)
+set(OPENVDB_URI https://github.com/dreamworksanimation/openvdb/archive/v${OPENVDB_VERSION}.tar.gz)
+set(OPENVDB_HASH 30a7e9571a03ab7bcf1a39fb62aa436f)
+
+set(IDNA_VERSION 2.6)
+set(CHARDET_VERSION 3.0.2)
+set(URLLIB3_VERSION 1.22)
+set(CERTIFI_VERSION 2017.7.27.1)
+set(REQUESTS_VERSION 2.18.4)
+
+set(NUMPY_VERSION v1.13.1)
+set(NUMPY_SHORT_VERSION 1.13)
+set(NUMPY_URI https://pypi.python.org/packages/c0/3a/40967d9f5675fbb097ffec170f59c2ba19fc96373e73ad47c2cae9a30aed/numpy-1.13.1.zip)
+set(NUMPY_HASH 2c3c0f4edf720c3a7b525dacc825b9ae)
+
+set(LAME_VERSION 3.99.5)
+set(LAME_URI http://downloads.sourceforge.net/project/lame/lame/3.99/lame-${LAME_VERSION}.tar.gz)
+set(LAME_HASH 84835b313d4a8b68f5349816d33e07ce)
+
+set(OGG_VERSION 1.3.2)
+set(OGG_URI http://downloads.xiph.org/releases/ogg/libogg-${OGG_VERSION}.tar.gz)
+set(OGG_HASH e19ee34711d7af328cb26287f4137e70630e7261b17cbe3cd41011d73a654692)
+
+set(VORBIS_VERSION 1.3.5)
+set(VORBIS_URI http://downloads.xiph.org/releases/vorbis/libvorbis-${VORBIS_VERSION}.tar.gz)
+set(VORBIS_HASH 6efbcecdd3e5dfbf090341b485da9d176eb250d893e3eb378c428a2db38301ce)
+
+set(THEORA_VERSION 1.1.1)
+set(THEORA_URI http://downloads.xiph.org/releases/theora/libtheora-${THEORA_VERSION}.tar.bz2)
+set(THEORA_HASH b6ae1ee2fa3d42ac489287d3ec34c5885730b1296f0801ae577a35193d3affbc)
+
+set(FLAC_VERSION 1.3.1)
+set(FLAC_URI http://downloads.xiph.org/releases/flac/flac-${FLAC_VERSION}.tar.xz)
+set(FLAC_HASH 4773c0099dba767d963fd92143263be338c48702172e8754b9bc5103efe1c56c)
+
+set(VPX_VERSION 1.5.0)
+set(VPX_URI http://storage.googleapis.com/downloads.webmproject.org/releases/webm/libvpx-${VPX_VERSION}.tar.bz2)
+set(VPX_HASH 306d67908625675f8e188d37a81fbfafdf5068b09d9aa52702b6fbe601c76797)
+
+set(ORC_VERSION 0.4.25)
+set(ORC_URI https://gstreamer.freedesktop.org/src/orc/orc-${ORC_VERSION}.tar.xz)
+set(ORC_HASH c1b1d54a58f26d483f0b3881538984789fe5d5460ab8fab74a1cacbd3d1c53d1)
+
+set(SCHROEDINGER_VERSION 1.0.11)
+set(SCHROEDINGER_URI https://download.videolan.org/contrib/schroedinger/schroedinger-${SCHROEDINGER_VERSION}.tar.gz)
+set(SCHROEDINGER_HASH 1e572a0735b92aca5746c4528f9bebd35aa0ccf8619b22fa2756137a8cc9f912)
+
+set(X264_URI http://download.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-20160401-2245-stable.tar.bz2)
+set(X264_HASH 1e9a7b835e80313aade53a9b6ff353e099de3856bf5f30a4d8dfc91281f786f5)
+
+set(XVIDCORE_VERSION 1.3.4)
+set(XVIDCORE_URI http://downloads.xvid.org/downloads/xvidcore-${XVIDCORE_VERSION}.tar.gz)
+set(XVIDCORE_HASH 4e9fd62728885855bc5007fe1be58df42e5e274497591fec37249e1052ae316f)
+
+#this has to be in sync with the version in blenders /extern folder
+set(OPENJPEG_VERSION 1.5.2)
+set(OPENJPEG_SHORT_VERSION 1.5)
+set(OPENJPEG_URI https://github.com/uclouvain/openjpeg/archive/version.${OPENJPEG_VERSION}.tar.gz)
+set(OPENJPEG_HASH 3734e95edd0bef6e056815591755efd822228dc3cd866894e00a2c929026b16d)
+
+set(FAAD_VERSION 2-2.7)
+set(FAAD_URI http://downloads.sourceforge.net/faac/faad${FAAD_VERSION}.tar.bz2)
+set(FAAD_HASH 4c332fa23febc0e4648064685a3d4332)
+
+set(FFMPEG_VERSION 3.2.1)
+set(FFMPEG_URI http://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2)
+set(FFMPEG_HASH cede174178e61f882844f5870c35ce72)
+
+set(FFTW_VERSION 3.3.4)
+set(FFTW_URI http://www.fftw.org/fftw-${FFTW_VERSION}.tar.gz)
+set(FFTW_HASH 2edab8c06b24feeb3b82bbb3ebf3e7b3)
+
+set(ICONV_VERSION 1.14)
+set(ICONV_URI http://ftp.gnu.org/pub/gnu/libiconv/libiconv-${ICONV_VERSION}.tar.gz)
+set(ICONV_HASH e34509b1623cec449dfeb73d7ce9c6c6)
+
+set(LAPACK_VERSION 3.6.0)
+set(LAPACK_URI http://www.netlib.org/lapack/lapack-${LAPACK_VERSION}.tgz)
+set(LAPACK_HASH f2f6c67134e851fe189bb3ca1fbb5101)
+
+set(SNDFILE_VERSION 1.0.28)
+set(SNDFILE_URI http://www.mega-nerd.com/libsndfile/files/libsndfile-${SNDFILE_VERSION}.tar.gz)
+set(SNDFILE_HASH 646b5f98ce89ac60cdb060fcd398247c)
+
+#set(HIDAPI_VERSION 0.8.0-rc1)
+#set(HIDAPI_URI https://github.com/signal11/hidapi/archive/hidapi-${HIDAPI_VERSION}.tar.gz)
+#set(HIDAPI_HASH 069f9dd746edc37b6b6d0e3656f47199)
+
+set(HIDAPI_UID 89a6c75dc6f45ecabd4ddfbd2bf5ba6ad8ba38b5)
+set(HIDAPI_URI https://github.com/TheOnlyJoey/hidapi/archive/${HIDAPI_UID}.zip)
+set(HIDAPI_HASH b6e22f6b514f8bcf594989f20ffc46fb)
+
+set(WEBP_VERSION 0.5.1)
+set(WEBP_URI https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-${WEBP_VERSION}.tar.gz)
+set(WEBP_HASH 3d7db92ebba5b4f679413d25c6040881)
+
+set(SPNAV_VERSION 0.2.3)
+set(SPNAV_URI http://downloads.sourceforge.net/project/spacenav/spacenav%20library%20%28SDK%29/libspnav%20${SPNAV_VERSION}/libspnav-${SPNAV_VERSION}.tar.gz)
+set(SPNAV_HASH 44d840540d53326d4a119c0f1aa7bf0a)
+
+set(JEMALLOC_VERSION 5.0.1)
+set(JEMALLOC_URI https://github.com/jemalloc/jemalloc/releases/download/${JEMALLOC_VERSION}/jemalloc-${JEMALLOC_VERSION}.tar.bz2)
+set(JEMALLOC_HASH 507f7b6b882d868730d644510491d18f)
+
+set(XML2_VERSION 2.9.4)
+set(XML2_URI ftp://xmlsoft.org/libxml2/libxml2-${XML2_VERSION}.tar.gz)
+set(XML2_HASH ae249165c173b1ff386ee8ad676815f5)
diff --git a/build_files/build_environment/cmake/vorbis.cmake b/build_files/build_environment/cmake/vorbis.cmake
new file mode 100644
index 00000000000..d16c7c6a1bc
--- /dev/null
+++ b/build_files/build_environment/cmake/vorbis.cmake
@@ -0,0 +1,38 @@
+# ***** 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 *****
+
+ExternalProject_Add(external_vorbis
+ URL ${VORBIS_URI}
+ DOWNLOAD_DIR ${DOWNLOAD_DIR}
+ URL_HASH SHA256=${VORBIS_HASH}
+ PREFIX ${BUILD_DIR}/vorbis
+ CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/vorbis/src/external_vorbis/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/vorbis
+ --disable-shared
+ --enable-static
+ --with-pic
+ --with-ogg=${LIBDIR}/ogg
+ BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/vorbis/src/external_vorbis/ && make -j${MAKE_THREADS}
+ INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/vorbis/src/external_vorbis/ && make install
+ INSTALL_DIR ${LIBDIR}/vorbis
+)
+
+add_dependencies(external_vorbis external_ogg)
+
+if(MSVC)
+ set_target_properties(external_vorbis PROPERTIES FOLDER Mingw)
+endif()
diff --git a/build_files/build_environment/cmake/vpx.cmake b/build_files/build_environment/cmake/vpx.cmake
new file mode 100644
index 00000000000..9d155be1c6c
--- /dev/null
+++ b/build_files/build_environment/cmake/vpx.cmake
@@ -0,0 +1,60 @@
+# ***** 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(WIN32)
+ if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
+ set(VPX_EXTRA_FLAGS --target=x86_64-win64-gcc)
+ else()
+ set(VPX_EXTRA_FLAGS --target=x86-win32-gcc)
+ endif()
+else()
+ if(APPLE)
+ set(VPX_EXTRA_FLAGS --target=x86_64-darwin13-gcc)
+ else()
+ set(VPX_EXTRA_FLAGS --target=generic-gnu)
+ endif()
+endif()
+
+ExternalProject_Add(external_vpx
+ URL ${VPX_URI}
+ DOWNLOAD_DIR ${DOWNLOAD_DIR}
+ URL_HASH SHA256=${VPX_HASH}
+ PREFIX ${BUILD_DIR}/vpx
+ CONFIGURE_COMMAND ${CONFIGURE_ENV} &&
+ cd ${BUILD_DIR}/vpx/src/external_vpx/ &&
+ ${CONFIGURE_COMMAND_NO_TARGET} --prefix=${LIBDIR}/vpx
+ --disable-shared
+ --enable-static
+ --disable-install-bins
+ --disable-install-srcs
+ --disable-sse4_1
+ --disable-sse3
+ --disable-ssse3
+ --disable-avx
+ --disable-avx2
+ --disable-unit-tests
+ --disable-examples
+ ${VPX_EXTRA_FLAGS}
+ BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/vpx/src/external_vpx/ && make -j${MAKE_THREADS}
+ INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/vpx/src/external_vpx/ && make install
+ INSTALL_DIR ${LIBDIR}/vpx
+)
+
+if(MSVC)
+ set_target_properties(external_vpx PROPERTIES FOLDER Mingw)
+endif()
diff --git a/build_files/build_environment/cmake/webp.cmake b/build_files/build_environment/cmake/webp.cmake
new file mode 100644
index 00000000000..0504988a088
--- /dev/null
+++ b/build_files/build_environment/cmake/webp.cmake
@@ -0,0 +1,50 @@
+# ***** 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 *****
+
+# Note the utility apps may use png/tiff/gif system libraries, but the
+# library itself does not depend on them, so should give no problems.
+
+set(WEBP_EXTRA_ARGS
+ -DWEBP_HAVE_SSE2=ON
+ -DWEBP_HAVE_SSE41=OFF
+ -DWEBP_HAVE_AVX2=OFF
+)
+
+if(WIN32)
+ set(WEBP_BUILD_DIR ${BUILD_MODE}/)
+else()
+ set(WEBP_BUILD_DIR)
+endif()
+
+ExternalProject_Add(external_webp
+ URL ${WEBP_URI}
+ DOWNLOAD_DIR ${DOWNLOAD_DIR}
+ URL_HASH MD5=${WEBP_HASH}
+ PREFIX ${BUILD_DIR}/webp
+ CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/webp -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${WEBP_EXTRA_ARGS}
+ INSTALL_COMMAND COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/webp/src/external_webp-build/${WEBP_BUILD_DIR}${LIBPREFIX}webp${LIBEXT} ${LIBDIR}/webp/lib/${LIBPREFIX}webp${LIBEXT} &&
+ ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/webp/src/external_webp/src/webp/decode.h ${LIBDIR}/webp/include/webp/decode.h &&
+ ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/webp/src/external_webp/src/webp/encode.h ${LIBDIR}/webp/include/webp/encode.h &&
+ ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/webp/src/external_webp/src/webp/demux.h ${LIBDIR}/webp/include/webp/demux.h &&
+ ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/webp/src/external_webp/src/webp/extras.h ${LIBDIR}/webp/include/webp/extras.h &&
+ ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/webp/src/external_webp/src/webp/format_constants.h ${LIBDIR}/webp/include/webp/format_constants.h &&
+ ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/webp/src/external_webp/src/webp/mux.h ${LIBDIR}/webp/include/webp/mux.h &&
+ ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/webp/src/external_webp/src/webp/mux_types.h ${LIBDIR}/webp/include/webp/mux_types.h &&
+ ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/webp/src/external_webp/src/webp/types.h ${LIBDIR}/webp/include/webp/types.h
+ INSTALL_DIR ${LIBDIR}/webp
+)
diff --git a/build_files/build_environment/cmake/x264.cmake b/build_files/build_environment/cmake/x264.cmake
new file mode 100644
index 00000000000..64029ca1b5e
--- /dev/null
+++ b/build_files/build_environment/cmake/x264.cmake
@@ -0,0 +1,40 @@
+# ***** 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(WIN32)
+ set(X264_EXTRA_ARGS --enable-win32thread --cross-prefix=${MINGW_HOST}- --host=${MINGW_HOST})
+endif()
+
+ExternalProject_Add(external_x264
+ URL ${X264_URI}
+ DOWNLOAD_DIR ${DOWNLOAD_DIR}
+ URL_HASH SHA256=${X264_HASH}
+ PREFIX ${BUILD_DIR}/x264
+ CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/x264/src/external_x264/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/x264
+ --enable-static
+ --enable-pic
+ --disable-lavf
+ ${X264_EXTRA_ARGS}
+ BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/x264/src/external_x264/ && make -j${MAKE_THREADS}
+ INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/x264/src/external_x264/ && make install
+ INSTALL_DIR ${LIBDIR}/x264
+)
+
+if(MSVC)
+ set_target_properties(external_x264 PROPERTIES FOLDER Mingw)
+endif()
diff --git a/build_files/build_environment/cmake/xml2.cmake b/build_files/build_environment/cmake/xml2.cmake
new file mode 100644
index 00000000000..a8f87a67ad4
--- /dev/null
+++ b/build_files/build_environment/cmake/xml2.cmake
@@ -0,0 +1,36 @@
+# ***** 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 *****
+
+ExternalProject_Add(external_xml2
+ URL ${XML2_URI}
+ DOWNLOAD_DIR ${DOWNLOAD_DIR}
+ URL_HASH MD5=${XML2_HASH}
+ PREFIX ${BUILD_DIR}/xml2
+ CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/xml2/src/external_xml2/ && ${CONFIGURE_COMMAND}
+ --prefix=${LIBDIR}/xml2
+ --disable-shared
+ --enable-static
+ --with-pic
+ --with-python=no
+ --with-lzma=no
+ --with-zlib=no
+ --with-iconv=no
+ BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/xml2/src/external_xml2/ && make -j${MAKE_THREADS}
+ INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/xml2/src/external_xml2/ && make install
+ INSTALL_DIR ${LIBDIR}/xml2
+)
diff --git a/build_files/build_environment/cmake/xvidcore.cmake b/build_files/build_environment/cmake/xvidcore.cmake
new file mode 100644
index 00000000000..a341275ea47
--- /dev/null
+++ b/build_files/build_environment/cmake/xvidcore.cmake
@@ -0,0 +1,44 @@
+# ***** 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(WIN32)
+ set(XVIDCORE_EXTRA_ARGS --host=${MINGW_HOST})
+endif()
+
+ExternalProject_Add(external_xvidcore
+ URL ${XVIDCORE_URI}
+ DOWNLOAD_DIR ${DOWNLOAD_DIR}
+ URL_HASH SHA256=${XVIDCORE_HASH}
+ PREFIX ${BUILD_DIR}/xvidcore
+ CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/xvidcore/src/external_xvidcore/build/generic && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/xvidcore ${XVIDCORE_EXTRA_ARGS}
+ BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/xvidcore/src/external_xvidcore/build/generic && make -j${MAKE_THREADS}
+ INSTALL_COMMAND ${CONFIGURE_ENV} &&
+ ${CMAKE_COMMAND} -E remove ${LIBDIR}/xvidcore/lib/* && # clean because re-installing fails otherwise
+ cd ${BUILD_DIR}/xvidcore/src/external_xvidcore/build/generic && make install
+ INSTALL_DIR ${LIBDIR}/xvidcore
+)
+
+ExternalProject_Add_Step(external_xvidcore after_install
+ COMMAND ${CMAKE_COMMAND} -E rename ${LIBDIR}/xvidcore/lib/xvidcore.a ${LIBDIR}/xvidcore/lib/libxvidcore.a || true
+ COMMAND ${CMAKE_COMMAND} -E remove ${LIBDIR}/xvidcore/lib/xvidcore.dll.a
+ DEPENDEES install
+)
+
+if(MSVC)
+ set_target_properties(external_xvidcore PROPERTIES FOLDER Mingw)
+endif()
diff --git a/build_files/build_environment/cmake/zlib.cmake b/build_files/build_environment/cmake/zlib.cmake
new file mode 100644
index 00000000000..3307cb1f167
--- /dev/null
+++ b/build_files/build_environment/cmake/zlib.cmake
@@ -0,0 +1,33 @@
+# ***** 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 *****
+
+ExternalProject_Add(external_zlib
+ URL ${ZLIB_URI}
+ URL_HASH MD5=${ZLIB_HASH}
+ DOWNLOAD_DIR ${DOWNLOAD_DIR}
+ PREFIX ${BUILD_DIR}/zlib
+ CMAKE_ARGS -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_INSTALL_PREFIX=${LIBDIR}/zlib ${DEFAULT_CMAKE_FLAGS}
+ INSTALL_DIR ${LIBDIR}/zlib
+)
+
+if(BUILD_MODE STREQUAL Debug)
+ ExternalProject_Add_Step(external_zlib after_install
+ COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/zlib/lib/zlibstaticd${LIBEXT} ${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
+ DEPENDEES install
+ )
+endif()
diff --git a/build_files/build_environment/cmake/zlib_mingw.cmake b/build_files/build_environment/cmake/zlib_mingw.cmake
new file mode 100644
index 00000000000..13345f29ffa
--- /dev/null
+++ b/build_files/build_environment/cmake/zlib_mingw.cmake
@@ -0,0 +1,40 @@
+# ***** 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 *****
+
+ExternalProject_Add(external_zlib_mingw
+ URL ${ZLIB_URI}
+ URL_HASH MD5=${ZLIB_HASH}
+ DOWNLOAD_DIR ${DOWNLOAD_DIR}
+ PREFIX ${BUILD_DIR}/zlib_mingw
+ CONFIGURE_COMMAND echo .
+ BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/zlib_mingw/src/external_zlib_mingw/ && make -f win32/makefile.gcc -j${MAKE_THREADS}
+ INSTALL_COMMAND echo .
+ INSTALL_DIR ${LIBDIR}/zlib_mingw
+)
+
+if(BUILD_MODE STREQUAL Release)
+ ExternalProject_Add_Step(external_zlib_mingw after_install
+ COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/zlib_mingw/src/external_zlib_mingw/libz.a ${LIBDIR}/zlib/lib/z.lib
+ DEPENDEES install
+ )
+endif()
+
+if(MSVC)
+ set_target_properties(external_zlib_mingw PROPERTIES FOLDER Mingw)
+endif()
+