-
Notifications
You must be signed in to change notification settings - Fork 0
/
Workspace.pro
189 lines (158 loc) · 5.5 KB
/
Workspace.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
TEMPLATE = app
TARGET = Workspace
QT += core gui xml opengl
CONFIG += debug
INCLUDEPATH += ./GeneratedFiles \
./GeneratedFiles/Debug \
./GraphicsLibrary/Mesh/SurfaceMesh \
./Utility
include(Workspace.pri)
win32{
LIBS += -L$$PWD"/GUI/Viewer/libQGLViewer/QGLViewer/lib" \
-lopengl32 \
-lglu32
CONFIG(debug, debug|release){
LIBS += -lQGLViewerd2
}else{
LIBS += -lQGLViewer2
}
}
linux {
CONFIG(debug, debug|release){
QMAKE_CXXFLAGS+= -ggdb -g3 -O0 -fopenmp
QMAKE_LFLAGS *= -fopenmp
LIBS += -lGLEW -lGLU -lGL -lQGLViewer
}
}
macx{
LIBS += -lGLEW
}
QT_VERSION=$$[QT_VERSION]
### Unix configuration ###
unix {
CONFIG -= debug debug_and_release
CONFIG *= release
isEmpty( PREFIX ) {
# Try same INCLUDE_DIR and LIB_DIR parameters than for the make install.
PREFIX=/usr
}
# LIB_NAME
LIB_NAME = libQGLViewer*.so*
macx|darwin-g++ {
LIB_NAME = libQGLViewer.$${QMAKE_EXTENSION_SHLIB}
}
hpux {
LIB_NAME = libQGLViewer*.sl*
}
!isEmpty( QGLVIEWER_STATIC ) {
LIB_NAME = libQGLViewer*.a
}
# LIB_DIR
isEmpty( LIB_DIR ) {
LIB_DIR = $${PREFIX}/lib
}
!exists( $${LIB_DIR}/$${LIB_NAME} ) {
exists( ../../QGLViewer/$${LIB_NAME} ) {
#message( The library was found in ../../QGLViewer which will be set as the LIB_DIR )
LIB_DIR = ../../QGLViewer
}
}
!exists( $${LIB_DIR}/$${LIB_NAME} ) {
exists( ../../QGLViewer-build-desktop/$${LIB_NAME} ) {
#message( The library was found in ../../QGLViewer-build-desktop which will be set as the LIB_DIR )
LIB_DIR = ../../QGLViewer-build-desktop
}
}
macx|darwin-g++ {
!exists( $${LIB_DIR}/$${LIB_NAME} ) {
# DYLIB was not found, try to find Framework instead
LIB_NAME = QGLViewer.framework/QGLViewer
LIB_DIR = ~/Library/Frameworks
# qmake does not handle tilde
LIB_DIR = $$system(cd $${LIB_DIR};pwd)
!exists( $${LIB_DIR}/$${LIB_NAME} ) {
exists( ../../QGLViewer/$${LIB_NAME} ) {
#message( The framework was found in ../../QGLViewer which will be set as the LIB_DIR )
LIB_DIR = ../../QGLViewer
}
}
!exists( $${LIB_DIR}/$${LIB_NAME} ) {
exists( ../../QGLViewer-build-desktop/$${LIB_NAME} ) {
#message( The framework was found in ../../QGLViewer-build-desktop which will be set as the LIB_DIR )
LIB_DIR = ../../QGLViewer-build-desktop
}
}
}
}
!exists( $${LIB_DIR}/$${LIB_NAME} ) {
message( Unable to find $${LIB_NAME} in $${LIB_DIR}. Make sure you have built it. )
message( You should run qmake LIB_DIR=/path/to/QGLViewer/$${LIB_NAME} )
}
# The actual directory where the library/framework was found
LIB_DIR_ABSOLUTE_PATH = $$system(cd $${LIB_DIR};pwd)
# INCLUDE_DIR
isEmpty( INCLUDE_DIR ) {
INCLUDE_DIR = $${PREFIX}/include
}
macx|darwin-g++ {
!exists( $${INCLUDE_DIR}/QGLViewer/qglviewer.h ) {
INCLUDE_DIR=$${LIB_DIR}/QGLViewer.framework
exists( $${LIB_DIR}/QGLViewer.framework/Headers/QGLViewer/qglviewer.h ) {
INCLUDE_DIR = $${LIB_DIR}/QGLViewer.framework/Headers
}
}
}
!exists( $${INCLUDE_DIR}/QGLViewer/qglviewer.h ) {
exists( ../../QGLViewer/qglviewer.h ) {
# message( libQGLViewer header files were not installed in standard $${INCLUDE_DIR} directory )
# message( Headers were found in ../.. which will be set as the INCLUDE_DIR )
INCLUDE_DIR = ../..
}
}
!exists( $${INCLUDE_DIR}/QGLViewer/qglviewer.h ) {
message( Unable to find QGLViewer/qglviewer.h in $${INCLUDE_DIR} )
error( Use qmake INCLUDE_DIR=/path/to/QGLViewerDir )
}
macx|darwin-g++ {
# On Mac, the lib path can be specified in the executable using install_name_tool
contains( LIB_NAME, ".*QGLViewer.framework.*" ) {
# If framework was not found in a standard directory
!contains( LIB_DIR, ".*/Library/Frameworks/*$" ) {
QMAKE_LFLAGS += -F$${LIB_DIR}
!plugin:QMAKE_POST_LINK=install_name_tool -change QGLViewer.framework/Versions/2/QGLViewer $${LIB_DIR_ABSOLUTE_PATH}/QGLViewer.framework/Versions/2/QGLViewer $${TARGET}.app/Contents/MacOS/$${TARGET}
}
LIBS += -F$${LIB_DIR} -framework QGLViewer
} else {
!plugin:QMAKE_POST_LINK=install_name_tool -change libQGLViewer.2.dylib $${LIB_DIR_ABSOLUTE_PATH}/libQGLViewer.2.dylib $${TARGET}.app/Contents/MacOS/$${TARGET}
LIBS *= -L$${LIB_DIR} -lQGLViewer
}
} else {
isEmpty(QMAKE_LFLAGS_RPATH) {
!plugin:QMAKE_LFLAGS += -Wl,-rpath,$${LIB_DIR_ABSOLUTE_PATH}
} else {
!plugin:QMAKE_RPATHDIR *= $${LIB_DIR_ABSOLUTE_PATH}
}
LIBS *= -L$${LIB_DIR} -lQGLViewer
# Qt 4.8 removed the GLU dependency
QMAKE_LIBS_OPENGL *= -lGLU
}
# Paths were correctly detected
INCLUDEPATH *= $${INCLUDE_DIR}
DEPENDPATH *= $${INCLUDE_DIR}
!isEmpty( QGLVIEWER_STATIC ) {
LIBS *= $${LIB_DIR}/$${LIB_NAME}
}
macx|darwin-g++ {
!contains( QT_VERSION, "^4.*" ) {
# Qt3 only
LIBS *= -lobjc
CONFIG -= thread
}
}
# Remove debugging options in release mode makes files much smaller
release:QMAKE_CFLAGS_RELEASE -= -g
release:QMAKE_CXXFLAGS_RELEASE -= -g
# Intermediate files are created in an hidden folder
MOC_DIR = .moc
OBJECTS_DIR = .obj
}