forked from NCCA/NGL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNGL.pro
270 lines (235 loc) · 7.46 KB
/
NGL.pro
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
# -------------------------------------------------
# Project created by QtCreator 2009-11-05T12:31:57
# -------------------------------------------------
# qt 5 wants this may cause errors with 4
isEqual(QT_MAJOR_VERSION, 5) {cache() }
# We will use the built in Qt lib template
TEMPLATE = lib
QT += opengl
QT += core
QT += gui
QT -=xml
CONFIG+=c++11
# use this to remove any marked as deprecated classes from NGL
DEFINES += REMOVEDDEPRECATED
# Use this to add GLM to the ShaderLib (assumes glm in include path)
DEFINES+= USEGLM
# What image library to use change to 1 of these depending on what platform
# QImage USEQIMAGE
# ImageMagick USEIMAGEMAGIC
# OpenImageIO USEOIIO
IMAGELIB=USEQIMAGE
# add this to the global defines
DEFINES +=$$IMAGELIB
equals(IMAGELIB,"USEIMAGEMAGIC"){
QMAKE_CXXFLAGS+=$$system(Magick++-config --cppflags )
LIBS+=$$system(Magick++-config --ldflags --libs )
message("Using Image Magick config is")
message($$system(Magick++-config --cppflags ) )
message($$system(Magick++-config --ldflags --libs ))
}
equals(IMAGELIB,"USEOIIO"){
LIBS+=-L/usr/local/lib/ -lOpenImageIO
}
# to ensure we don't get any ABI issues use c++ and correct libs on mac
# as I want to support 4.8 and 5 this will set a flag for some of the mac stuff
# mainly in the types.h file for the setMacVisual which is native in Qt5
isEqual(QT_MAJOR_VERSION, 5) {DEFINES +=QT5BUILD }
# define this if you want to include the stanford data sets
# these are very big and make compilation time huge
DEFINES+=ADDLARGEMODELS
# set the base directory of our project so Qt knows where to find them
# we can use shell vars but need to use $$
NGLPATH=$$(NGLDIR)
isEmpty(NGLPATH){ # note brace must be here
BASE_DIR=$$(HOME)/NGL
}
else{ # note brace must be here
BASE_DIR=$$(NGLDIR)
}
message($${BASE_DIR})
# This is the output target we want to create
TARGET = $$BASE_DIR/lib/NGL
# this is where we want to put the intermediate build files ( ../obj)
OBJECTS_DIR = $$BASE_DIR/obj
QMAKE_LFLAGS-= -headerpad_max_install_names
QMAKE_LFLAGS_SHLIB -= -single_module
QMAKE_LFLAGS_VERSION=
QMAKE_LFLAGS_COMPAT_VERSION=
QMAKE_LFLAGS_SONAME=
# use this to suppress some warning from boost
unix:QMAKE_CXXFLAGS_WARN_ON += "-Wno-unused-parameter"
# define the NGL_DEBUG flag for the graphics lib
DEFINES += NGL_DEBUG
# if you install boost to /usr/local/include/ we can find it from this line
# basically all you need to do is copy the headers from the boost source to this
# location cp -R boost_1_49_0/boost /usr/local/include under linux use apt-get install
unix:INCLUDEPATH+=/usr/local/include
#set some flags for sse etc
QMAKE_CFLAGS+= -DGLEW_NO_GLU -DGLEW_STATIC
unix:QMAKE_CXXFLAGS_WARN_ON += -Wno-builtin-macro-redefined -isystem
macx:DEFINES +=GL_DO_NOT_WARN_IF_MULTI_GL_VERSION_HEADERS_INCLUDED
macx {
QMAKE_POST_LINK = install_name_tool -id @rpath/$$PWD/lib/libNGL.1.0.0.dylib $$PWD/lib/libNGL.1.0.0.dylib
}
# this is where to look for includes
INCLUDEPATH += $$BASE_DIR/include/ngl
INCLUDEPATH += $$BASE_DIR/glew/
INCLUDEPATH += $$BASE_DIR/src/ngl
INCLUDEPATH +=$$BASE_DIR/src/shaders
INCLUDEPATH +=$$BASE_DIR/include/rapidjson
# using the fmt library https://github.com/fmtlib/fmt but header only.
DEFINES+=FMT_HEADER_ONLY
INCLUDEPATH +=$$BASE_DIR/include/fmt
unix:LIBS += -L/usr/local/lib
# set the SRC_DIR so we can find the project files
SRC_DIR = $$BASE_DIR/src
DEFINES+=BOOST_SYSTEM_NO_DEPRECATED
DEFINES+=BOOST_ERROR_CODE_HEADER_ONLY
# and the include files
INC_DIR = $$BASE_DIR/include/ngl
DEPENDPATH= $$INC_DIR
DEPENDPATH +=$$SRC_DIR/ngl/
DEPENDPATH +=$$SRC_DIR/shaders/
QMAKE_CXXFLAGS+=-Wall
macx:{
QMAKE_CXXFLAGS+= -fPIC
LIBS+= -L/System/Library/Frameworks/OpenGL.framework/Libraries -framework OpenGL
LIBS+= -Wl,-framework,Cocoa
#DEFINES += DARWIN
#QMAKE_MAC_SDK=macosx10.13
}
# in this case unix is also mac so we need to exclude mac from the unix build
win32|unix:!macx{
# now define some linux specific flags
unix:QMAKE_CXXFLAGS+= -march=native
#unix:DEFINES += LINUX
unix:LIBS+= -L/usr/lib64 -lGL -lGLU -lX11
}
# The windows configuration is very frustrating however I seem to have it working now
# you will need to install boost in the path below
# once you have done this set the PATH environment variable to look in
# c:/NGL/lib to find the DLL
win32{
message("Using Windows check to see what needs to be installed")
CONFIG+=staticlib
INCLUDEPATH +=C:/boost/
INCLUDEPATH += C:/SDKs/ #for university STEM build
DEFINES+=_USE_MATH_DEFINES
# Silence some boost warnings
DEFINES+= _SCL_SECURE_NO_WARNINGS
DESTDIR=c:/
DEFINES += NO_DLL
DEFINES += GLEW_STATIC
}
SOURCES += $$SRC_DIR/Vec4.cpp \
$$SRC_DIR/VAOPrimitives.cpp \
$$SRC_DIR/Util.cpp \
$$SRC_DIR/Texture.cpp \
$$SRC_DIR/SpotLight.cpp \
$$SRC_DIR/ShaderLib.cpp \
$$SRC_DIR/Transformation.cpp \
$$SRC_DIR/RibExport.cpp \
$$SRC_DIR/Quaternion.cpp \
$$SRC_DIR/PathCamera.cpp \
$$SRC_DIR/Obj.cpp \
$$SRC_DIR/Mat4.cpp \
$$SRC_DIR/Material.cpp \
$$SRC_DIR/Light.cpp \
$$SRC_DIR/NGLInit.cpp \
$$SRC_DIR/Colour.cpp \
$$SRC_DIR/Camera.cpp \
$$SRC_DIR/NCCABinMesh.cpp \
$$SRC_DIR/BezierCurve.cpp \
$$SRC_DIR/BBox.cpp \
$$SRC_DIR/AbstractMesh.cpp \
$$SRC_DIR/Random.cpp \
$$SRC_DIR/NCCAPointBake.cpp \
$$SRC_DIR/Shader.cpp \
$$SRC_DIR/ShaderProgram.cpp \
$$SRC_DIR/Plane.cpp \
$$SRC_DIR/AABB.cpp \
$$SRC_DIR/createDefaultVAOs.cpp \
$$SRC_DIR/Vec3.cpp \
$$SRC_DIR/Vec2.cpp \
$$SRC_DIR/Text.cpp \
$$SRC_DIR/Mat3.cpp \
$$SRC_DIR/AbstractSerializer.cpp \
$$SRC_DIR/XMLSerializer.cpp \
$$SRC_DIR/NGLStream.cpp \
$$SRC_DIR/Logger.cpp \
$$SRC_DIR/Image.cpp \
$$SRC_DIR/VAOFactory.cpp \
$$SRC_DIR/AbstractVAO.cpp \
$$SRC_DIR/MultiBufferVAO.cpp \
$$SRC_DIR/SimpleVAO.cpp \
$$SRC_DIR/SimpleIndexVAO.cpp
#exclude this from iOS
win32|unix|macx:{
SOURCES+=glew/glew.c
}
ios {
message("IOS BUILD")
DEFINES+=USINGIOS_
}
isEqual(QT_MAJOR_VERSION, 4) {
OBJECTIVE_SOURCES += $$SRC_DIR/setGL32VisualMac.mm
}
HEADERS += $$INC_DIR/Vec4.h \
$$INC_DIR/VAOPrimitives.h \
$$INC_DIR/Singleton.h \
$$INC_DIR/Util.h \
$$INC_DIR/Types.h \
$$INC_DIR/Texture.h \
$$INC_DIR/SpotLight.h \
$$INC_DIR/ShaderLib.h \
$$INC_DIR/RibExport.h \
$$INC_DIR/Transformation.h \
$$INC_DIR/Quaternion.h \
$$INC_DIR/PathCamera.h \
$$INC_DIR/Obj.h \
$$INC_DIR/NGLassert.h \
$$INC_DIR/Mat4.h \
$$INC_DIR/Material.h \
$$INC_DIR/Light.h \
$$INC_DIR/NGLInit.h \
$$INC_DIR/Colour.h \
$$INC_DIR/Camera.h \
$$INC_DIR/BezierCurve.h \
$$INC_DIR/NCCABinMesh.h \
$$INC_DIR/BBox.h \
$$INC_DIR/AbstractMesh.h \
$$INC_DIR/Random.h \
$$INC_DIR/NCCAPointBake.h \
$$INC_DIR/Shader.h \
$$INC_DIR/ShaderProgram.h \
$$INC_DIR/Plane.h \
$$INC_DIR/AABB.h \
$$INC_DIR/Vec3.h \
$$INC_DIR/Vec2.h \
$$INC_DIR/Text.h \
$$INC_DIR/Mat3.h \
$$INC_DIR/Logger.h \
$$INC_DIR/Image.h \
$$INC_DIR/VAOFactory.h \
$$INC_DIR/AbstractVAO.h \
$$INC_DIR/SimpleVAO.h \
$$INC_DIR/SimpleIndexVAO.h \
$$INC_DIR/MultiBufferVAO.h \
$$INC_DIR/AbstractSerializer.h \
$$INC_DIR/XMLSerializer.h \
$$INC_DIR/NGLStream.h \
$$SRC_DIR/shaders/TextShaders.h \
$$SRC_DIR/shaders/ColourShaders.h \
$$SRC_DIR/shaders/DiffuseShaders.h \
$$SRC_DIR/shaders/ToonShaders.h \
$$INC_DIR/rapidxml/rapidxml.hpp \
$$INC_DIR/rapidxml/rapidxml_iterators.hpp \
$$INC_DIR/rapidxml/rapidxml_print.hpp \
$$INC_DIR/rapidxml/rapidxml_utils.hpp
unix:PRECOMPILED_HEADER += $$SRC_DIR/ngl/Meshes.h \
OTHER_FILES+= Doxyfile \
README.md \
CMakeLists.txt
DISTFILES += \
NGLUML.qmodel