|
| 1 | +# scons configuration file |
| 2 | + |
| 3 | +import os, platform |
| 4 | + |
| 5 | + |
| 6 | +# Optional FLTK 2 paths |
| 7 | +vars = Variables('custom.py') |
| 8 | +vars.Add(PathVariable('fltk_include_path', 'Point to the fltk header files', '', PathVariable.PathAccept)) |
| 9 | +vars.Add(PathVariable('fltk_lib_path', 'Point to the fltk library files', '', PathVariable.PathAccept)) |
| 10 | + |
| 11 | + |
| 12 | +# Path setup |
| 13 | +env = Environment(variables = vars) |
| 14 | + |
| 15 | +env.ParseConfig("fltk2-config --cxxflags --ldflags") |
| 16 | +env.ParseConfig( 'pkg-config --cflags --libs sigc++-2.0' ) |
| 17 | + |
| 18 | +# Linked libraries |
| 19 | +env.Append(LIBS = ['tinyxml', 'GL', 'GLU', 'fltk2_gl', 'fltk2_images', 'jpeg', 'png','tiff']) |
| 20 | + |
| 21 | + |
| 22 | +if platform.system() == 'Linux': |
| 23 | + env.Append(CPPPATH = ['/usr/include/', '/usr/include/GL', '$fltk_include_path', '/usr/local/include/fltk/compat/']) |
| 24 | + env.Append(LIBPATH = ['.', '/usr/lib/', '/usr/local/lib', '/usr/X11R6/lib', '$fltk_lib_path']) |
| 25 | + |
| 26 | +elif platform.system() == 'Darwin': |
| 27 | +# OS X |
| 28 | + env.Append(CPPPATH = ['/System/Library/Frameworks/OpenGL.framework/Headers', '$fltk_include_path', '/usr/local/include/fltk/compat']) |
| 29 | + env.Append(LIBPATH = ['.', '/usr/local/lib', '/usr/X11R6/lib', '/opt/local/lib', '$fltk_lib_path']) |
| 30 | + env.Append(LINKFLAGS = ['-framework', 'Cocoa', '-framework', 'AGL', '-framework', 'OpenGL', '-framework', 'Carbon']) |
| 31 | + |
| 32 | +else: |
| 33 | + print "Unknown platform: " + platform.system() |
| 34 | + Exit(1) |
| 35 | + |
| 36 | + |
| 37 | +# Check GL headers |
| 38 | +conf = Configure(env) |
| 39 | +if not conf.CheckCHeader('gl.h') or not conf.CheckCHeader('glu.h'): |
| 40 | + print 'Shrimp requires OpenGL and GLU' |
| 41 | + Exit(1) |
| 42 | + |
| 43 | +# Check FLTK 2 headers |
| 44 | +if not conf.CheckCXXHeader('fltk/run.h'): |
| 45 | + print 'Shrimp requires FLTK 2' |
| 46 | + Exit(1) |
| 47 | + |
| 48 | +# Check for libsigc++ |
| 49 | +if not conf.TryAction('pkg-config --exists sigc++-2.0')[0]: |
| 50 | + print 'Shrimp requires libsigc++ 2.x' |
| 51 | + Exit(1) |
| 52 | + |
| 53 | +# Check for libtiff |
| 54 | +#TODO |
| 55 | + |
| 56 | +env = conf.Finish() |
| 57 | + |
| 58 | + |
| 59 | +# Debug |
| 60 | +#env.Append(CXXFLAGS = '-O2') |
| 61 | +env.Append(CXXFLAGS = '-g -Wall') |
| 62 | +#env.Append(LINKFLAGS = '-static-libgcc') |
| 63 | + |
| 64 | + |
| 65 | +# TinyXML |
| 66 | +StaticLibrary('tinyxml', Split(""" |
| 67 | + src/miscellaneous/tinyxml/tinystr.cpp |
| 68 | + src/miscellaneous/tinyxml/tinyxml.cpp |
| 69 | + src/miscellaneous/tinyxml/tinyxmlerror.cpp |
| 70 | + src/miscellaneous/tinyxml/tinyxmlparser.cpp |
| 71 | +""")) |
| 72 | + |
| 73 | + |
| 74 | +# Shrimp |
| 75 | +env.Append(CPPPATH = ['src/application', 'src/miscellaneous', 'src/shading']) |
| 76 | + |
| 77 | +shrimp_files = Split(""" |
| 78 | + src/miscellaneous/misc_system_functions.cpp |
| 79 | + src/miscellaneous/misc_xml.cpp |
| 80 | + src/miscellaneous/logging.cpp |
| 81 | +
|
| 82 | + src/shading/preferences.cpp |
| 83 | + src/shading/shader_block.cpp |
| 84 | + src/shading/scene.cpp |
| 85 | + src/shading/scene_blocks.cpp |
| 86 | + src/shading/scene_grouping.cpp |
| 87 | + src/shading/scene_serialization.cpp |
| 88 | + src/shading/rib_root_block.cpp |
| 89 | + src/shading/rib_root_block_parsing.cpp |
| 90 | +
|
| 91 | + src/services.cpp |
| 92 | + src/opengl_view.cpp |
| 93 | +
|
| 94 | + src/application/shrimp.cpp |
| 95 | + src/application/ui_about.cpp |
| 96 | + src/application/ui_application_window.cpp |
| 97 | + src/application/ui_scene_view.cpp |
| 98 | + src/application/ui_splash.cpp |
| 99 | + src/application/tiffImage.cxx |
| 100 | +""") |
| 101 | + |
| 102 | + |
| 103 | +env.Program(target = 'shrimp', source = shrimp_files) |
| 104 | + |
| 105 | + |
| 106 | +# File change test |
| 107 | +Decider('timestamp-match') |
| 108 | + |
0 commit comments