forked from bartvdbraak/blender
59ef51aa27
Currently only put sources of Ceres library into extern/libmv/third_party and setup CMake and SCons building systems. Integration details: - Even CMake build files are not re-used from Ceres's trunk: they're using some automatic stuff detection like glog, pthreads, protobuf and so and it's not so clear how to re-use that files without modifications. And IMO it's easier if build files are getting re-generated automatically to match Blender-specific setup rather than keeping changes made locally in Blender in sync when re-bundling Ceres library. Especially in case when it's already needed to support SCons build system. - Integrated only actual sources, all tests were stripped. Probably it'll be nice to have them, but they'll need clear integration with current module test stuff in Blender. - Suitesparse was disabled. It'll help a lot having it, but there are some difficulties making cholmod working fine on windows. Would be added in future - collections_port.cc was also stripped. It's not used by Ceres's upstream and it gives compilation error (undefined uint32 -- looks like namespace issue). - Currently all schur eliminators are included. Not sure if it makes sense, also not sure if it makes sense having them switchable on and off -- IMO better to have single configuration which works and does not require special tweaks after everything was set up. To bundle updated version of Ceres: - Go to extern/libmv/third_party/ceres folder - Run ./bundle.sh This will checkout fresh Ceres snapshot of Windows branch (which is currently most interesting from integration into Blender POV), apply all patches listed in patches/series and copy needed files into Blender's working copy. This will also re-generate CMake/SCons build rules. If you'll need extra files from Ceres repository which are not present in Blender, you'll need to copy them manually and then run ./mkfiles.sh from extern/libmv/third_party/ceres folder which will update list of files used by Blender. Thanks to Leir Mierle and Sameer Agarwal (and all others who helped developing Ceres) this library and thanks to Keir Mierle with help integrating it into Blender!
70 lines
2.5 KiB
Python
70 lines
2.5 KiB
Python
#!/usr/bin/python
|
|
|
|
# NOTE: This file is automatically generated by bundle.sh script
|
|
# If you're doing changes in this file, please update template
|
|
# in that script too
|
|
|
|
import sys
|
|
import os
|
|
|
|
Import('env')
|
|
|
|
defs = []
|
|
|
|
cflags_libmv = Split(env['CFLAGS'])
|
|
ccflags_libmv = Split(env['CCFLAGS'])
|
|
cxxflags_libmv = Split(env['CXXFLAGS'])
|
|
|
|
defs.append('V3DLIB_ENABLE_SUITESPARSE')
|
|
defs.append('GOOGLE_GLOG_DLL_DECL=')
|
|
|
|
src = env.Glob("*.cpp")
|
|
src += env.Glob('libmv/image/*.cc')
|
|
src += env.Glob('libmv/multiview/*.cc')
|
|
src += env.Glob('libmv/numeric/*.cc')
|
|
src += env.Glob('libmv/simple_pipeline/*.cc')
|
|
src += env.Glob('libmv/tracking/*.cc')
|
|
src += env.Glob('third_party/fast/*.c')
|
|
src += env.Glob('third_party/gflags/*.cc')
|
|
src += env.Glob('third_party/ldl/Source/*.c')
|
|
src += env.Glob('third_party/ssba/Geometry/*.cpp')
|
|
src += env.Glob('third_party/ssba/Math/*.cpp')
|
|
|
|
incs = '. ../Eigen3 third_party/ceres/include'
|
|
incs += ' ' + env['BF_PNG_INC']
|
|
incs += ' ' + env['BF_ZLIB_INC']
|
|
|
|
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
|
|
incs += ' ./third_party/glog/src/windows ./third_party/glog/src/windows/glog'
|
|
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
|
|
incs += ' ./third_party/msinttypes'
|
|
|
|
src += ['./third_party/glog/src/logging.cc', './third_party/glog/src/raw_logging.cc', './third_party/glog/src/utilities.cc', './third_party/glog/src/vlog_is_on.cc']
|
|
src += ['./third_party/glog/src/windows/port.cc']
|
|
|
|
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
|
|
cflags_libmv.append('/Od')
|
|
ccflags_libmv.append('/Od')
|
|
cxxflags_libmv.append('/Od')
|
|
|
|
if not env['BF_DEBUG']:
|
|
defs.append('NDEBUG')
|
|
else:
|
|
if not env['BF_DEBUG']:
|
|
cflags_libmv += Split(env['REL_CFLAGS'])
|
|
ccflags_libmv += Split(env['REL_CCFLAGS'])
|
|
cxxflags_libmv += Split(env['REL_CXXFLAGS'])
|
|
else:
|
|
src += env.Glob("third_party/glog/src/*.cc")
|
|
incs += ' ./third_party/glog/src'
|
|
if not env['BF_DEBUG']:
|
|
cflags_libmv += Split(env['REL_CFLAGS'])
|
|
ccflags_libmv += Split(env['REL_CCFLAGS'])
|
|
cxxflags_libmv += Split(env['REL_CXXFLAGS'])
|
|
|
|
incs += ' ./third_party/ssba ./third_party/ldl/Include ../colamd/Include'
|
|
|
|
env.BlenderLib ( libname = 'extern_libmv', sources=src, includes=Split(incs), defines=defs, libtype=['extern', 'player'], priority=[20,137], compileflags=cflags_libmv, cc_compileflags=ccflags_libmv, cxx_compileflags=cxxflags_libmv )
|
|
|
|
SConscript(['third_party/SConscript'])
|