diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-09-15 14:03:17 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-09-15 14:03:17 +0400 |
commit | b93da9b01e163158a830872d29f8bd874f63d54d (patch) | |
tree | 59730d1145eba4638a5128d0cc2c5fe3215007ab /build_files/scons | |
parent | 8add19d3ece8526f5334acec90fd4c1f1155218c (diff) |
Color Management, Stage 1: Initial OpenColorIO library integration
This commit integrates support of OpenColorIO library into build systems.
It also contains C-API for OpenColorIO library which could be used by Blender.
CMake has got find rules familiar to OpenImageIO's one which makes it easier
for build system to find needed libraries and includes. Scons only could use
explicitly defined paths to libraries and includes.
C-API would be compiled and Blender would be linked against C-API and OpenColorIO
but it wouldn't affect on Blender behavior at all.
OpenColorIO could be disabled by setting up WITH_OCIO to Off in CMake and
setting WITH_BF_OCIO in Scons.
Diffstat (limited to 'build_files/scons')
-rw-r--r-- | build_files/scons/config/darwin-config.py | 6 | ||||
-rw-r--r-- | build_files/scons/config/linux-config.py | 10 | ||||
-rw-r--r-- | build_files/scons/config/win32-mingw-config.py | 6 | ||||
-rw-r--r-- | build_files/scons/config/win32-vc-config.py | 6 | ||||
-rw-r--r-- | build_files/scons/config/win64-mingw-config.py | 6 | ||||
-rw-r--r-- | build_files/scons/config/win64-vc-config.py | 7 | ||||
-rw-r--r-- | build_files/scons/tools/Blender.py | 12 | ||||
-rw-r--r-- | build_files/scons/tools/btools.py | 9 |
8 files changed, 62 insertions, 0 deletions
diff --git a/build_files/scons/config/darwin-config.py b/build_files/scons/config/darwin-config.py index 1ce9416d5c4..afab4131de8 100644 --- a/build_files/scons/config/darwin-config.py +++ b/build_files/scons/config/darwin-config.py @@ -287,6 +287,12 @@ BF_OIIO_INC = BF_OIIO + '/include' BF_OIIO_LIB = 'OpenImageIO' BF_OIIO_LIBPATH = BF_OIIO + '/lib' +WITH_BF_OCIO = True +BF_OCIO = LIBDIR + '/opencolorio' +BF_OCIO_INC = BF_OCIO + '/include' +BF_OCIO_LIB = 'OpenColorIO tinyxml yaml-cpp' +BF_OCIO_LIBPATH = BF_OCIO + '/lib' + WITH_BF_BOOST = True BF_BOOST = LIBDIR + '/boost' BF_BOOST_INC = BF_BOOST + '/include' diff --git a/build_files/scons/config/linux-config.py b/build_files/scons/config/linux-config.py index e97c3b8b9d7..5c16baa2ee8 100644 --- a/build_files/scons/config/linux-config.py +++ b/build_files/scons/config/linux-config.py @@ -215,6 +215,16 @@ BF_OIIO_INC = BF_OIIO + '/include' BF_OIIO_LIB = 'OpenImageIO' BF_OIIO_LIBPATH = BF_OIIO + '/lib' +WITH_BF_OCIO = True +WITH_BF_STATICOCIO = False +BF_OCIO = LIBDIR + '/ocio' +if not os.path.exists(LCGDIR + '/ocio'): + WITH_BF_OCIO = False + BF_OCIO = '/usr' +BF_OCIO_INC = BF_OCIO + '/include' +BF_OCIO_LIB = 'OpenColorIO yaml-cpp tinyxml' +BF_OCIO_LIBPATH = BF_OCIO + '/lib' + WITH_BF_BOOST = True WITH_BF_STATICBOOST = False BF_BOOST = LIBDIR + '/boost' diff --git a/build_files/scons/config/win32-mingw-config.py b/build_files/scons/config/win32-mingw-config.py index d46aaca5a07..95b2329f426 100644 --- a/build_files/scons/config/win32-mingw-config.py +++ b/build_files/scons/config/win32-mingw-config.py @@ -159,6 +159,12 @@ BF_OIIO_INC = BF_OIIO + '/include' BF_OIIO_LIB = 'OpenImageIO' BF_OIIO_LIBPATH = BF_OIIO + '/lib' +WITH_BF_OCIO = False +BF_OCIO = LIBDIR + '/opencolorio' +BF_OCIO_INC = BF_OCIO + '/include' +BF_OCIO_LIB = 'OpenColorIO' +BF_OCIO_LIBPATH = BF_OCIO + '/lib' + WITH_BF_BOOST = True BF_BOOST = LIBDIR + '/boost' BF_BOOST_INC = BF_BOOST + '/include' diff --git a/build_files/scons/config/win32-vc-config.py b/build_files/scons/config/win32-vc-config.py index 452bbaaf54f..b77ff8e70e0 100644 --- a/build_files/scons/config/win32-vc-config.py +++ b/build_files/scons/config/win32-vc-config.py @@ -161,6 +161,12 @@ BF_OIIO_INC = '${BF_OIIO}/include' BF_OIIO_LIB = 'OpenImageIO' BF_OIIO_LIBPATH = '${BF_OIIO}/lib' +WITH_BF_OCIO = True +BF_OCIO = '${LIBDIR}/opencolorio' +BF_OCIO_INC = '${BF_OCIO}/include' +BF_OCIO_LIB = 'OpenColorIO' +BF_OCIO_LIBPATH = '${BF_OCIO}/lib' + WITH_BF_BOOST = True BF_BOOST = '${LIBDIR}/boost' BF_BOOST_INC = '${BF_BOOST}/include' diff --git a/build_files/scons/config/win64-mingw-config.py b/build_files/scons/config/win64-mingw-config.py index 66ec65bb6ca..c2bf2df6d00 100644 --- a/build_files/scons/config/win64-mingw-config.py +++ b/build_files/scons/config/win64-mingw-config.py @@ -159,6 +159,12 @@ BF_OIIO_INC = '${BF_OIIO}/include' BF_OIIO_LIB = 'OpenImageIO' BF_OIIO_LIBPATH = '${BF_OIIO}/lib' +WITH_BF_OCIO = False +BF_OCIO = LIBDIR + '/opencolorio' +BF_OCIO_INC = '${BF_OCIO}/include' +BF_OCIO_LIB = 'OpenColorIO' +BF_OCIO_LIBPATH = '${BF_OCIO}/lib' + WITH_BF_BOOST = True BF_BOOST = LIBDIR + '/boost' BF_BOOST_INC = BF_BOOST + '/include' diff --git a/build_files/scons/config/win64-vc-config.py b/build_files/scons/config/win64-vc-config.py index b6a3c108cdb..4b719469c39 100644 --- a/build_files/scons/config/win64-vc-config.py +++ b/build_files/scons/config/win64-vc-config.py @@ -158,6 +158,13 @@ BF_OIIO_LIB = 'OpenImageIO' BF_OIIO_LIBPATH = '${BF_OIIO}/lib' BF_OIIO_LIBPATH = '${BF_OIIO}/lib' +WITH_BF_OCIO = True +BF_OCIO = '${LIBDIR}/opencolorio' +BF_OCIO_INC = '${BF_OCIO}/include' +BF_OCIO_LIB = 'OpenColorIO' +BF_OCIO_LIBPATH = '${BF_OCIO}/lib' +BF_OCIO_LIBPATH = '${BF_OCIO}/lib' + WITH_BF_BOOST = True BF_BOOST = '${LIBDIR}/boost' BF_BOOST_INC = '${BF_BOOST}/include' diff --git a/build_files/scons/tools/Blender.py b/build_files/scons/tools/Blender.py index 4ab020dc26a..1e114a43ae0 100644 --- a/build_files/scons/tools/Blender.py +++ b/build_files/scons/tools/Blender.py @@ -204,6 +204,11 @@ def setup_staticlibs(lenv): if lenv['WITH_BF_STATICOIIO']: statlibs += Split(lenv['BF_OIIO_LIB_STATIC']) + if lenv['WITH_BF_OCIO']: + libincs += Split(lenv['BF_OCIO_LIBPATH']) + if lenv['WITH_BF_STATICOCIO']: + statlibs += Split(lenv['BF_OCIO_LIB_STATIC']) + if lenv['WITH_BF_BOOST']: libincs += Split(lenv['BF_BOOST_LIBPATH']) if lenv['WITH_BF_STATICBOOST']: @@ -252,6 +257,10 @@ def setup_syslibs(lenv): if not lenv['WITH_BF_STATICOIIO']: syslibs += Split(lenv['BF_OIIO_LIB']) + if lenv['WITH_BF_OCIO']: + if not lenv['WITH_BF_STATICOCIO']: + syslibs += Split(lenv['BF_OCIO_LIB']) + if lenv['WITH_BF_OPENEXR'] and not lenv['WITH_BF_STATICOPENEXR']: syslibs += Split(lenv['BF_OPENEXR_LIB']) if lenv['WITH_BF_TIFF'] and not lenv['WITH_BF_STATICTIFF']: @@ -584,6 +593,9 @@ def AppIt(target=None, source=None, env=None): commands.getoutput(cmd) cmd = 'cp -R %s/release/datafiles/fonts %s/%s.app/Contents/MacOS/%s/datafiles/'%(bldroot,installdir,binary,VERSION) commands.getoutput(cmd) + if env['WITH_BF_OCIO']: + cmd = 'cp -R %s/release/datafiles/colormanagement %s/%s.app/Contents/MacOS/%s/datafiles/'%(bldroot,installdir,binary,VERSION) + commands.getoutput(cmd) cmd = 'cp -R %s/release/scripts %s/%s.app/Contents/MacOS/%s/'%(bldroot,installdir,binary,VERSION) commands.getoutput(cmd) diff --git a/build_files/scons/tools/btools.py b/build_files/scons/tools/btools.py index 2fa503f3f26..633492ba0ee 100644 --- a/build_files/scons/tools/btools.py +++ b/build_files/scons/tools/btools.py @@ -163,6 +163,7 @@ def validate_arguments(args, bc): 'WITH_BF_3DMOUSE', 'WITH_BF_STATIC3DMOUSE', 'BF_3DMOUSE', 'BF_3DMOUSE_INC', 'BF_3DMOUSE_LIB', 'BF_3DMOUSE_LIBPATH', 'BF_3DMOUSE_LIB_STATIC', 'WITH_BF_CYCLES', 'WITH_BF_CYCLES_CUDA_BINARIES', 'BF_CYCLES_CUDA_NVCC', 'BF_CYCLES_CUDA_NVCC', 'WITH_BF_CYCLES_CUDA_THREADED_COMPILE', 'WITH_BF_OIIO', 'WITH_BF_STATICOIIO', 'BF_OIIO', 'BF_OIIO_INC', 'BF_OIIO_LIB', 'BF_OIIO_LIB_STATIC', 'BF_OIIO_LIBPATH', + 'WITH_BF_OCIO', 'WITH_BF_STATICOCIO', 'BF_OCIO', 'BF_OCIO_INC', 'BF_OCIO_LIB', 'BF_OCIO_LIB_STATIC', 'BF_OCIO_LIBPATH', 'WITH_BF_BOOST', 'WITH_BF_STATICBOOST', 'BF_BOOST', 'BF_BOOST_INC', 'BF_BOOST_LIB', 'BF_BOOST_LIB_STATIC', 'BF_BOOST_LIBPATH', 'WITH_BF_LIBMV' ] @@ -575,6 +576,14 @@ def read_opts(env, cfg, args): ('BF_OIIO_LIBPATH', 'OIIO library path', ''), ('BF_OIIO_LIB_STATIC', 'OIIO static library', ''), + (BoolVariable('WITH_BF_OCIO', 'Build with OpenColorIO', False)), + (BoolVariable('WITH_BF_STATICOCIO', 'Staticly link to OpenColorIO', False)), + ('BF_OCIO', 'OCIO root path', ''), + ('BF_OCIO_INC', 'OCIO include path', ''), + ('BF_OCIO_LIB', 'OCIO library', ''), + ('BF_OCIO_LIBPATH', 'OCIO library path', ''), + ('BF_OCIO_LIB_STATIC', 'OCIO static library', ''), + (BoolVariable('WITH_BF_BOOST', 'Build with Boost', False)), (BoolVariable('WITH_BF_STATICBOOST', 'Staticly link to boost', False)), ('BF_BOOST', 'Boost root path', ''), |