예제 #1
0
def _build_environment():
    result = scons.Environment(options = options)
    result.Tool('subst', toolpath = [os.path.dirname(__file__)+'/tools'])

    if 'icpc' in result['CXX']:
        result.Append(CCFLAGS='-wd177,383,424,810,981,1418,1419,1572')
        result.Append(LINKFLAGS='-static-intel')

    if oshelper.os_is_windows():
        if result.get('OPENSCENEGRAPH_DEBUG', None):  # FIXME move this elswhere
            result.Append(CXXFLAGS='/EHsc /W3 /MDd /wd4099 /wd4244 /wd4800 /wd4996 /wd4251 /wd4661') # FIXME remove deactivation of warnings
        else:
            result.Append(CXXFLAGS=['/EHsc', '/W3', '/MD', '/wd4099', '/wd4244', '/wd4800', '/wd4996', '/wd4251', '/wd4661']) # FIXME remove deactivation of warnings
        
        result.Append(CPPDEFINES=['AV_INSTANTIATE_FIELD_TEMPLATES'])
		  
        result.Append(CCFLAGS='/bigobj')
        result.Append(LINKFLAGS=['/MANIFEST'])
        result['SHLINKCOM'] = [result['SHLINKCOM'], 'mt.exe -nologo -manifest ${TARGET}.manifest -outputresource:$TARGET;2']
    else:
        result.Append(CCFLAGS='-ansi -Wall')

    if result['DEBUG']:
        if oshelper.os_is_windows():
            result.Append(CCFLAGS='/DEBUG /Zi /D_DEBUG /Ob0 /Od /RTC1')
        else:
            result.Append(CCFLAGS='-g')
    else:
        if not oshelper.os_is_windows():
            result.Append(CCFLAGS='-O2 -DNDEBUG')
            if result['CXX'] == 'g++':
                result.Append(CCFLAGS='-fno-strict-aliasing')

    if result['TRACE_LOGGING']:
        result.Append(CPPDEFINES='TRACE_LOGGING')

    if result['BUILD_32']:
        #linux or mac
        if not oshelper.os_is_windows():
            result.Append(CCFLAGS='-m32')
            result.Append(LINKFLAGS='-m32')
        #windows
        else:
            result.Append(CPPDEFINES=['WIN32'])
    else:
        if oshelper.os_is_windows():
            result.Append(CPPDEFINES=['WIN32'])
            result.Append(LINKFLAGS='/MACHINE:X64')
		

    result.PrependENVPath('PATH', result['BINARY_PATH'])
    result.Prepend(CPPPATH=result['INCLUDE_PATH'].split(os.pathsep))
    result.Prepend(LIBPATH=result['LIBRARY_PATH'].split(os.pathsep))
    result.PrependENVPath(oshelper.get_library_search_path_env(), result['LIBRARY_PATH'])
    result.PrependENVPath('PYTHONPATH', result['PYTHON_PATH'])
    result.PrependENVPath('PKG_CONFIG_PATH', result['PKG_CONFIG_PATH'])
    os.environ['PKG_CONFIG_PATH'] = result['PKG_CONFIG_PATH']
    return result
예제 #2
0
파일: utility.py 프로젝트: wobakj/avango
def make_vcproject(env, name, target_name):
    if not oshelper.os_is_windows():
        return

    sources = env.FindSourceFiles()
    sourceList = []
    prepend_string = ''

    if env['DEBUG']:
        mode = 'Debug'
    else:
        mode = 'Release'

    for s in sources:
        sourceList.append('..\\' + s.srcnode().path)

    build_target_list = []
    build_target_list.append('check-' + target_name)
    build_target_list.append(target_name)

    variant_list = []
    variant_list.append('Check|Win32')
    variant_list.append(mode + '|Win32')

    project = env.MSVSProject(
        target=name + env['MSVSPROJECTSUFFIX'],
        auto_build_solution=0,
        srcs=sourceList,
        #incs = includes,
        buildtarget=build_target_list,
        variant=variant_list)
    scons.Alias('vcprojects', project)
예제 #3
0
파일: utility.py 프로젝트: 4og/avango
def make_vcproject(env, name, target_name):
    if not oshelper.os_is_windows():
        return

    sources =  env.FindSourceFiles()
    sourceList = []
    prepend_string = ''

    if env['DEBUG']:
        mode = 'Debug'
    else:
        mode = 'Release'

    for s in sources:
        sourceList.append('..\\' + s.srcnode().path)

    build_target_list = []
    build_target_list.append('check-'+target_name)
    build_target_list.append(target_name)

    variant_list = []
    variant_list.append('Check|Win32')
    variant_list.append(mode+'|Win32')

    project = env.MSVSProject(target = name + env['MSVSPROJECTSUFFIX'],
                              auto_build_solution=0,
                              srcs =  sourceList,
                              #incs = includes,
                              buildtarget = build_target_list,
                              variant = variant_list)
    scons.Alias('vcprojects', project)
예제 #4
0
파일: __init__.py 프로젝트: 4og/avango
def setup():
    scons.SetOption('duplicate', 'soft-hard-copy')

    env = _build_environment()
    Environment.env = env
    TestEnvironment.env = env.Clone()
    if 'AV_DEBUGGER' in os.environ:
        TestEnvironment.env['ENV']['AV_DEBUGGER'] = os.environ['AV_DEBUGGER']
    PythonEnvironment.env = _build_python_environment(env)

    scons.Help(options.GenerateHelpText(env))

    def CheckBoost(context):
        context.Message('Checking for boost library ... ')
        ret = context.TryRun("""
#include <iostream>
#include <boost/version.hpp>
int main(int argc, char **argv) {
  std::cout << BOOST_LIB_VERSION;
  return 0;
}
""", ".cpp")
        context.Result(ret[0])
        return ret[1]

    def CheckToolset(context):
        context.Message('Checking for toolset ... ')
        ret = context.TryRun("""
#include <iostream>
int main(int argc, char **argv) {
#ifdef __GNUC__
  std::cout << "gcc" << __GNUC__ << __GNUC_MINOR__;
#else
  std::cout << "unknown";
#endif
  return 0;
}
""", ".cpp")
        context.Result(ret[1])
        return ret[1]

    custom_tests = { 'CheckBoost':CheckBoost, 'CheckToolset':CheckToolset }
    conf_env = env.Clone()

    if os.path.abspath(env['BUILD']) != os.path.abspath('.'):
        scons.BuildDir(env['BUILD'], '.', not oshelper.os_is_windows())
        env.SConsignFile("${BUILD}/sconsign")
        conf = scons.Configure(conf_env, custom_tests = custom_tests,
                               conf_dir = "${BUILD}/.sconf_temp",
                               log_file = "${BUILD}/config.log",
                               help=False)
    else:
        conf = scons.Configure(conf_env, custom_tests = custom_tests,
                              help=False)

    env['BOOST_LIB_VERSION'] = conf.CheckBoost()
    env['BOOST_TOOLSET'] = conf.CheckToolset()
    conf.Finish()
예제 #5
0
파일: recipes.py 프로젝트: 4og/avango
def _setup_default():
    _plain_libs = """
        dl
        osg
        osgDB
        osgViewer
        osgParticle
        osgShadow
        osgText
        osgUtil
        osgGA
        osgFX
        OpenThreads
        alut
        openal
        vrpn
        CGAL
        gmp
        """

    for lib in _plain_libs.split():
        _config_store.set(lib, PlainConfig(libraries = [lib]))
        
    #add openthreads lib by default
    _config_store.set('osg', PlainConfig(libraries = ['osg', 'OpenThreads']))

    _config_store.set('boost_thread', BoostConfig('boost_thread'))
    _config_store.set('boost_signals', BoostConfig('boost_signals'))
    _config_store.set('boost_filesystem', BoostConfig('boost_filesystem'))
    _config_store.set('boost_regex', BoostConfig('boost_regex'))
    _config_store.set('boost_system', BoostConfig('boost_system'))
    _config_store.set('boost_date_time', BoostConfig('boost_date_time'))
    _config_store.set('boost_python', BoostConfig('boost_python', dependencies = ['python']))

    _config_store.set('avango-core', PKGConfig('avango-core'))
    _config_store.set('avango-daemon', PKGConfig('avango-daemon'))
    _config_store.set('avango-python', PlainConfig(libraries = ["avangoScript"]))
    _config_store.set('avango-osg', PKGConfig('avango-osg'))
    _config_store.set('avango-osgviewer', PKGConfig('avango-osgviewer'))
    _config_store.set('avango-moving', PKGConfig('avango-moving'))
    _config_store.set('avango-tools', PKGConfig('avango-tools'))
    _config_store.set('avango-ensemble', PKGConfig('avango-ensemble'))
    _config_store.set('avango-unittest', PKGConfig('avango-unittest'))
    _config_store.set('avango-sound', PlainConfig(libraries = ["avangoSound"]))
    _config_store.set('avango-shade', PlainConfig(libraries = ["avangoShade", "avangoShadeCore"]))
    _config_store.set('avango-utils', PlainConfig(libraries = ["avangoUtils"]))
    _config_store.set('vorbisfile', PKGConfig('vorbisfile'))
    _config_store.set('xerces', PlainConfig(libraries = ['xerces-c']))
    _config_store.set('graphicsMagick', PlainConfig(libraries = ['GraphicsMagick++']))

    _config_store.set('python', PythonConfig())
    
    _config_store.set('osgEarth', PlainConfig(libraries = ["osgEarth", "osgEarthUtil", "osgEarthFeatures"]))
    _config_store.set('pcl', PlainConfig(libraries = ["pcl_io", "pcl_io_ply", "pcl_common"]))


    # Dummy packages
    _config_store.set('osgUtil', PlainConfig(libraries = ['']))
    _config_store.set('GL', PlainConfig(libraries = ['']))
    _config_store.set('GLU', PlainConfig(libraries = ['']))

    if oshelper.os_is_mac():
      _config_store.set('osg', PlainConfig(libraries = ['osg', 'OpenThreads']))
      _config_store.set('osgUtil', PlainConfig(libraries = ['osgUtil']))
      _config_store.set('GL', PlainConfig(libraries = ['GL']))
      _config_store.set('GLU', PlainConfig(libraries = ['GLU']))
      
      # for avango extensions, there is no pkg-config
      _config_store.set('avango-core', PlainConfig(libraries = ['avango'], dependencies = ["boost_signals", "boost_thread", "boost_regex"]))
      _config_store.set('avango-osg', PlainConfig(libraries = ['avangoOsg'], dependencies = ['osg', 'osgDB', 'osgViewer', 'osgParticle', 'osgText', 'osgUtil']))
      _config_store.set('avango-utils', PlainConfig(libraries = ['avangoUtils']))
      _config_store.set('avango-tools', PlainConfig(libraries = ['avangoTools']))
      _config_store.set('avango-sound', PlainConfig(libraries = ['avangoSound']))
      _config_store.set('avango-osgviewer', PlainConfig(libraries = ['avangoOsgViewer']))

    # Override some libraries for Windows
    if oshelper.os_is_windows():
        # Boost libraries use auto-link
        _config_store.set('boost_thread', PlainConfig(libraries = ['']))
        _config_store.set('boost_signals', PlainConfig(libraries = ['']))
        _config_store.set('boost_regex', PlainConfig(libraries = ['']))
        _config_store.set('boost_python', PlainConfig(libraries = [''], dependencies = ["python"]))
        # dl is in standard system libraries
        # TODO check that dl functionality is included in system library
        _config_store.set('dl', PlainConfig(libraries = ['']))
        # Windows-only(?) OSG library
        _config_store.set('osg', PlainConfig(libraries = ['osg', 'OpenThreads']))
        _config_store.set('osgUtil', PlainConfig(libraries = ['osgUtil']))
        # GL libraries are required under Windows
        _config_store.set('GL', PlainConfig(libraries = ['OPENGL32']))
        _config_store.set('GLU', PlainConfig(libraries = ['GLU32']))
        # for avango extensions, there is no pkg-config
        _config_store.set('avango-core', PlainConfig(libraries = ['avango'], dependencies = ["boost_signals", "boost_thread", "boost_regex"]))
        _config_store.set('avango-osg', PlainConfig(libraries = ['avangoOsg'], dependencies = ['osg', 'osgDB', 'osgViewer', 'osgParticle', 'osgText', 'osgUtil']))
        _config_store.set('avango-utils', PlainConfig(libraries = ['avangoUtils']))
        _config_store.set('avango-tools', PlainConfig(libraries = ['avangoTools']))
        _config_store.set('avango-sound', PlainConfig(libraries = ['avangoSound']))
        _config_store.set('avango-osgviewer', PlainConfig(libraries = ['avangoOsgViewer']))
        # xerces
        _config_store.set('xerces', PlainConfig(libraries = ['xerces-c_2']))
예제 #6
0
def _setup_default():
    _plain_libs = """
        dl
        osg
        osgDB
        osgViewer
        osgParticle
        osgShadow
        osgText
        osgUtil
        osgGA
        osgFX
        OpenThreads
        alut
        openal
        vrpn
        CGAL
        gmp
        """

    for lib in _plain_libs.split():
        _config_store.set(lib, PlainConfig(libraries=[lib]))

    #add openthreads lib by default
    _config_store.set('osg', PlainConfig(libraries=['osg', 'OpenThreads']))

    _config_store.set('boost_thread', BoostConfig('boost_thread'))
    _config_store.set('boost_signals', BoostConfig('boost_signals'))
    _config_store.set('boost_filesystem', BoostConfig('boost_filesystem'))
    _config_store.set('boost_regex', BoostConfig('boost_regex'))
    _config_store.set('boost_system', BoostConfig('boost_system'))
    _config_store.set('boost_date_time', BoostConfig('boost_date_time'))
    _config_store.set('boost_python',
                      BoostConfig('boost_python', dependencies=['python']))

    _config_store.set('avango-core', PKGConfig('avango-core'))
    _config_store.set('avango-daemon', PKGConfig('avango-daemon'))
    _config_store.set('avango-python', PlainConfig(libraries=["avangoScript"]))
    _config_store.set('avango-osg', PKGConfig('avango-osg'))
    _config_store.set('avango-osgviewer', PKGConfig('avango-osgviewer'))
    _config_store.set('avango-moving', PKGConfig('avango-moving'))
    _config_store.set('avango-tools', PKGConfig('avango-tools'))
    _config_store.set('avango-ensemble', PKGConfig('avango-ensemble'))
    _config_store.set('avango-unittest', PKGConfig('avango-unittest'))
    _config_store.set('avango-sound', PlainConfig(libraries=["avangoSound"]))
    _config_store.set(
        'avango-shade',
        PlainConfig(libraries=["avangoShade", "avangoShadeCore"]))
    _config_store.set('avango-utils', PlainConfig(libraries=["avangoUtils"]))
    _config_store.set('vorbisfile', PKGConfig('vorbisfile'))
    _config_store.set('xerces', PlainConfig(libraries=['xerces-c']))
    _config_store.set('graphicsMagick',
                      PlainConfig(libraries=['GraphicsMagick++']))

    _config_store.set('python', PythonConfig())

    _config_store.set(
        'osgEarth',
        PlainConfig(
            libraries=["osgEarth", "osgEarthUtil", "osgEarthFeatures"]))
    _config_store.set(
        'pcl', PlainConfig(libraries=["pcl_io", "pcl_io_ply", "pcl_common"]))

    # Dummy packages
    _config_store.set('osgUtil', PlainConfig(libraries=['']))
    _config_store.set('GL', PlainConfig(libraries=['']))
    _config_store.set('GLU', PlainConfig(libraries=['']))

    if oshelper.os_is_mac():
        _config_store.set('osg', PlainConfig(libraries=['osg', 'OpenThreads']))
        _config_store.set('osgUtil', PlainConfig(libraries=['osgUtil']))
        _config_store.set('GL', PlainConfig(libraries=['GL']))
        _config_store.set('GLU', PlainConfig(libraries=['GLU']))

        # for avango extensions, there is no pkg-config
        _config_store.set(
            'avango-core',
            PlainConfig(
                libraries=['avango'],
                dependencies=["boost_signals", "boost_thread", "boost_regex"]))
        _config_store.set(
            'avango-osg',
            PlainConfig(libraries=['avangoOsg'],
                        dependencies=[
                            'osg', 'osgDB', 'osgViewer', 'osgParticle',
                            'osgText', 'osgUtil'
                        ]))
        _config_store.set('avango-utils',
                          PlainConfig(libraries=['avangoUtils']))
        _config_store.set('avango-tools',
                          PlainConfig(libraries=['avangoTools']))
        _config_store.set('avango-sound',
                          PlainConfig(libraries=['avangoSound']))
        _config_store.set('avango-osgviewer',
                          PlainConfig(libraries=['avangoOsgViewer']))

    # Override some libraries for Windows
    if oshelper.os_is_windows():
        # Boost libraries use auto-link
        _config_store.set('boost_thread', PlainConfig(libraries=['']))
        _config_store.set('boost_signals', PlainConfig(libraries=['']))
        _config_store.set('boost_regex', PlainConfig(libraries=['']))
        _config_store.set('boost_python',
                          PlainConfig(libraries=[''], dependencies=["python"]))
        # dl is in standard system libraries
        # TODO check that dl functionality is included in system library
        _config_store.set('dl', PlainConfig(libraries=['']))
        # Windows-only(?) OSG library
        _config_store.set('osg', PlainConfig(libraries=['osg', 'OpenThreads']))
        _config_store.set('osgUtil', PlainConfig(libraries=['osgUtil']))
        # GL libraries are required under Windows
        _config_store.set('GL', PlainConfig(libraries=['OPENGL32']))
        _config_store.set('GLU', PlainConfig(libraries=['GLU32']))
        # for avango extensions, there is no pkg-config
        _config_store.set(
            'avango-core',
            PlainConfig(
                libraries=['avango'],
                dependencies=["boost_signals", "boost_thread", "boost_regex"]))
        _config_store.set('avango-daemon',
                          PlainConfig(libraries=['avangoDaemon']))
        _config_store.set(
            'avango-osg',
            PlainConfig(libraries=['avangoOsg'],
                        dependencies=[
                            'osg', 'osgDB', 'osgViewer', 'osgParticle',
                            'osgText', 'osgUtil'
                        ]))
        _config_store.set('avango-utils',
                          PlainConfig(libraries=['avangoUtils']))
        _config_store.set('avango-tools',
                          PlainConfig(libraries=['avangoTools']))
        _config_store.set('avango-sound',
                          PlainConfig(libraries=['avangoSound']))
        _config_store.set('avango-osgviewer',
                          PlainConfig(libraries=['avangoOsgViewer']))
        # xerces
        _config_store.set('xerces', PlainConfig(libraries=['xerces-c_2']))
예제 #7
0
파일: __init__.py 프로젝트: wobakj/avango
def setup():
    scons.SetOption('duplicate', 'soft-hard-copy')

    env = _build_environment()
    Environment.env = env
    TestEnvironment.env = env.Clone()
    if 'AV_DEBUGGER' in os.environ:
        TestEnvironment.env['ENV']['AV_DEBUGGER'] = os.environ['AV_DEBUGGER']
    PythonEnvironment.env = _build_python_environment(env)

    scons.Help(options.GenerateHelpText(env))

    def CheckBoost(context):
        context.Message('Checking for boost library ... ')
        ret = context.TryRun(
            """
#include <iostream>
#include <boost/version.hpp>
int main(int argc, char **argv) {
  std::cout << BOOST_LIB_VERSION;
  return 0;
}
""", ".cpp")
        context.Result(ret[0])
        return ret[1]

    def CheckToolset(context):
        context.Message('Checking for toolset ... ')
        ret = context.TryRun(
            """
#include <iostream>
int main(int argc, char **argv) {
#ifdef __GNUC__
  std::cout << "gcc" << __GNUC__ << __GNUC_MINOR__;
#else
  #ifdef _MSC_VER
    std::cout << "VC++ " << _MSC_VER/100-6 << ".0";
  #else
    std::cout << "unknown";
  #endif
#endif
  return 0;
}
""", ".cpp")
        context.Result(ret[1])
        return ret[1]

    custom_tests = {'CheckBoost': CheckBoost, 'CheckToolset': CheckToolset}
    conf_env = env.Clone()

    if os.path.abspath(env['BUILD']) != os.path.abspath('.'):
        scons.BuildDir(env['BUILD'], '.', not oshelper.os_is_windows())
        env.SConsignFile("${BUILD}/sconsign")
        conf = scons.Configure(conf_env,
                               custom_tests=custom_tests,
                               conf_dir="${BUILD}/.sconf_temp",
                               log_file="${BUILD}/config.log",
                               help=False)
    else:
        conf = scons.Configure(conf_env, custom_tests=custom_tests, help=False)

    env['BOOST_LIB_VERSION'] = conf.CheckBoost()
    env['BOOST_TOOLSET'] = conf.CheckToolset()
    conf.Finish()
예제 #8
0
파일: __init__.py 프로젝트: wobakj/avango
def _build_environment():
    result = scons.Environment(options=options)
    result.Tool('subst', toolpath=[os.path.dirname(__file__) + '/tools'])

    if 'icpc' in result['CXX']:
        result.Append(CCFLAGS='-wd177,383,424,810,981,1418,1419,1572')
        result.Append(LINKFLAGS='-static-intel')

    if oshelper.os_is_windows():
        if result.get('OPENSCENEGRAPH_DEBUG',
                      None):  # FIXME move this elswhere
            result.Append(
                CXXFLAGS=
                '/EHsc /W3 /MDd /wd4099 /wd4244 /wd4800 /wd4996 /wd4251 /wd4661'
            )  # FIXME remove deactivation of warnings
        else:
            result.Append(CXXFLAGS=[
                '/EHsc', '/W3', '/MD', '/wd4099', '/wd4244', '/wd4800',
                '/wd4996', '/wd4251', '/wd4661'
            ])  # FIXME remove deactivation of warnings

        result.Append(CPPDEFINES=['AV_INSTANTIATE_FIELD_TEMPLATES'])

        result.Append(CCFLAGS='/bigobj')
        result.Append(LINKFLAGS=['/MANIFEST'])
        result['SHLINKCOM'] = [
            result['SHLINKCOM'],
            'mt.exe -nologo -manifest ${TARGET}.manifest -outputresource:$TARGET;2'
        ]
    else:
        result.Append(CCFLAGS='-ansi -Wall')

    if result['DEBUG']:
        if oshelper.os_is_windows():
            result.Append(CCFLAGS='/DEBUG /Zi /D_DEBUG /Ob0 /Od /RTC1')
        else:
            result.Append(CCFLAGS='-g')
    else:
        if not oshelper.os_is_windows():
            result.Append(CCFLAGS='-O2 -DNDEBUG')
            if result['CXX'] == 'g++':
                result.Append(CCFLAGS='-fno-strict-aliasing')

    if result['TRACE_LOGGING']:
        result.Append(CPPDEFINES='TRACE_LOGGING')

    if result['BUILD_32']:
        #linux or mac
        if not oshelper.os_is_windows():
            result.Append(CCFLAGS='-m32')
            result.Append(LINKFLAGS='-m32')
        #windows
        else:
            result.Append(CPPDEFINES=['WIN32'])
    else:
        if oshelper.os_is_windows():
            result.Append(CPPDEFINES=['WIN32'])
            result.Append(LINKFLAGS='/MACHINE:X64')

    result.PrependENVPath('PATH', result['BINARY_PATH'])
    result.Prepend(CPPPATH=result['INCLUDE_PATH'].split(os.pathsep))
    result.Prepend(LIBPATH=result['LIBRARY_PATH'].split(os.pathsep))
    result.PrependENVPath(oshelper.get_library_search_path_env(),
                          result['LIBRARY_PATH'])
    result.PrependENVPath('PYTHONPATH', result['PYTHON_PATH'])
    result.PrependENVPath('PKG_CONFIG_PATH', result['PKG_CONFIG_PATH'])
    os.environ['PKG_CONFIG_PATH'] = result['PKG_CONFIG_PATH']
    return result