deps_builder: Optionally build boost::python

This this adds the option of building boost::python
in the libs builder, in preparation for future
dependencies that require it (ie pyopenvdb)

disabled by default, can be enabled with the
`WITH_BOOST_PYTHON` cmake option.

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

Reviewed by: brecht
This commit is contained in:
Ray molenkamp 2020-08-12 10:17:38 -06:00
parent 240ac779d5
commit 6a95f05d65
4 changed files with 25 additions and 1 deletions

View File

@ -57,7 +57,6 @@ include(cmake/zlib.cmake)
include(cmake/openal.cmake)
include(cmake/png.cmake)
include(cmake/jpeg.cmake)
include(cmake/boost.cmake)
include(cmake/blosc.cmake)
include(cmake/pthreads.cmake)
include(cmake/openexr.cmake)
@ -89,6 +88,8 @@ include(cmake/python_site_packages.cmake)
include(cmake/package_python.cmake)
include(cmake/numpy.cmake)
include(cmake/usd.cmake)
# Boost needs to be included after python.cmake due to the PYTHON_BINARY variable being needed.
include(cmake/boost.cmake)
if(UNIX)
# Rely on PugiXML compiled with OpenImageIO
else()

View File

@ -49,6 +49,15 @@ else()
endif()
endif()
if(WITH_BOOST_PYTHON)
set(JAM_FILE ${BUILD_DIR}/boost.user-config.jam)
configure_file(${PATCH_DIR}/boost.user.jam.in ${JAM_FILE})
set(BOOST_PYTHON_OPTIONS
--with-python
--user-config=${JAM_FILE}
)
endif()
set(BOOST_OPTIONS
--with-filesystem
--with-locale
@ -65,6 +74,7 @@ set(BOOST_OPTIONS
-sNO_LZMA=1
-sNO_ZSTD=1
${BOOST_TOOLSET}
${BOOST_PYTHON_OPTIONS}
)
string(TOLOWER ${BUILD_MODE} BOOST_BUILD_TYPE)
@ -81,3 +91,11 @@ ExternalProject_Add(external_boost
BUILD_IN_SOURCE 1
INSTALL_COMMAND "${BOOST_HARVEST_CMD}"
)
if(WITH_BOOST_PYTHON)
add_dependencies(
external_boost
external_python
external_numpy
)
endif()

View File

@ -20,6 +20,7 @@ if(WIN32)
option(ENABLE_MINGW64 "Enable building of ffmpeg/iconv/libsndfile/fftw3 by installing mingw64" ON)
endif()
option(WITH_WEBP "Enable building of oiio with webp support" OFF)
option(WITH_BOOST_PYTHON "Enable building of boost with python support" OFF)
set(MAKE_THREADS 1 CACHE STRING "Number of threads to run make with")
if(NOT BUILD_MODE)

View File

@ -0,0 +1,4 @@
using python : @PYTHON_SHORT_VERSION@ : @PYTHON_BINARY@
: @LIBDIR@/python/include @LIBDIR@/python/include/python@PYTHON_SHORT_VERSION@m/
: @LIBDIR@/python/libs
;