-
Notifications
You must be signed in to change notification settings - Fork 0
/
UseNGL.pri
93 lines (78 loc) · 2.56 KB
/
UseNGL.pri
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
#This file is included in any project that requires NGL it will be searched for
#in the default $(HOME)/NGL/ directory if this can't be found the environment variable $NGLDIR will be searched for and this will be used.
# hack to change compiler for w115 as g++ breaks
linux*{
HOST=$$system("hostname -s|cut -c 1-4")
equals(HOST, "w115"){
message("doing z420 compiler hack for w115")
QMAKE_CXX=clang++
QMAKE_CC=clang
QMAKE_LINK=clang++
}
}
CONFIG+=c++14
macx:CONFIG-=app_bundle
# 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) {
cache()
DEFINES +=QT5BUILD
}
NGLPATH=$$(NGLDIR)
DEFINES+=FMT_HEADER_ONLY
DEFINES += USEGLM
DEFINES+=GLM_ENABLE_EXPERIMENTAL
isEmpty(NGLPATH){ # note brace must be here
NGLBASE=$$(HOME)/NGL
}
else{ # note brace must be here
NGLBASE=$$(NGLDIR)
}
message($${NGLBASE})
# use this to suppress some warning
unix*:QMAKE_CXXFLAGS_WARN_ON += "-Wno-unused-parameter"
# basic compiler flags (not all appropriate for all platforms)
# QMAKE_CXXFLAGS+=
macx:QMAKE_CXXFLAGS+= -arch x86_64
macx:INCLUDEPATH+=/usr/local/include/
linux-g++:QMAKE_CXXFLAGS += -march=native -Wno-unused-variable
linux-g++-64:QMAKE_CXXFLAGS += -march=native
# define the _DEBUG flag for the graphics lib
DEFINES +=NGL_DEBUG
QMAKE_RPATHDIR+=L$${NGLBASE}/lib
# added for university build
INCLUDEPATH+=/public/devel/include
unix:LIBS += -L/usr/local/lib
# add the ngl lib note the { } for the environment variable QMake variable's value at time qmake is run
unix:LIBS += -L$${NGLBASE}/lib -l NGL
# now if we are under unix and not on a Mac (i.e. linux)
linux-*{
linux-*:QMAKE_CXXFLAGS += -march=native
#LIBS+=-ltiff
}
DEPENDPATH+=include
# if we are on a mac define DARWIN
macx:message("Building for macOS High Sierra using sdk 10.13 if this is not found")
macx:message("Modify UseNGL.pri and modify QMAKE_MACK_SDK to macosx10.11 or whatever you have installed")
#macx:QMAKE_MAC_SDK = macosx10.13
# this is where to look for includes
INCLUDEPATH += $${NGLBASE}/include/
INCLUDEPATH += $${NGLBASE}/gl3w/
win32: {
PRE_TARGETDEPS+=C:/NGL/lib/NGL.lib
INCLUDEPATH+=-I c:/boost
DEFINES+=GL42
DEFINES += WIN32
DEFINES+=_WIN32
DEFINES+=_USE_MATH_DEFINES
LIBS+= -lopengl32
LIBS += -LC:/NGL/lib/ -lNGL
DEFINES+=NO_DLL
}
ios {
message("IOS BUILD")
DEFINES+=USINGIOS_
INCLUDEPATH+=/usr/local/include
LIBS += -L$${NGLBASE}/lib -lNGLIOS
}
QMAKE_RPATHDIR+=$${NGLBASE}/lib