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