~jakob-flierl/bullet-physics-playground/master

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
win32-msvc* {
## Someone needs to try this with VC90

# VC90 needs:
#
# * VC 2008 SP1: Fix for vector <function <FT>> crash.
#   http://www.microsoft.com/en-us/download/details.aspx?id=15303
# * ..

  DEFINES += WIN32_VC90

# TODO: send your pull request and update the wiki.
}

link_koppi_style_win32 {
  message("Statically linking win32 libs (koppi style)")

## The libs are in C:\lib on koppi's hard drive. See:
#  github.com/koppi/bullet-physics-playground/wiki/Build-on-Windows

  WIN32_DIR_LIB = C:\\lib

  WIN32_DIR_DLL = $$WIN32_DIR_LIB\\dll

  LIBS += -L$$WIN32_DIR_DLL

  DEFINES += WIN32_LINK_QGLVIEWER
#  DEFINES += WIN32_LINK_GLUT
  DEFINES += WIN32_LINK_LIB3DS
  DEFINES += WIN32_LINK_BULLET
  DEFINES += WIN32_LINK_LUA
  DEFINES += WIN32_LINK_LUABIND
  DEFINES += WIN32_LINK_FREEGLUT
  DEFINES += WIN32_LINK_GLEW
  DEFINES += WIN32_LINK_BOOST

  DEFINES += WIN32_LINK_AUTOIMPORT

  DEFINES -= HAS_LIB_ASSIMP

  WIN32_DIR_LUA       = $$WIN32_DIR_LIB\\lua-5.1.4-win32-dll
  WIN32_DIR_LUABIND   = $$WIN32_DIR_LIB\\luabind-0.9.1
  WIN32_DIR_QGLVIEWER = $$WIN32_DIR_LIB\\libQGLViewer-2.5.1
  WIN32_DIR_LIB3DS    = $$WIN32_DIR_LIB\\lib3ds-1.3.0

## We use glut lib included with bullet.

  WIN32_DIR_GLUT      = $$WIN32_DIR_LIB\\bullet-r2552\\Glut
  WIN32_DIR_FREEGLUT  = $$WIN32_DIR_LIB\\freeglut-2.8.1-1-mingw\\freeglut
  WIN32_DIR_GLEW      = $$WIN32_DIR_LIB\\glew-1.10.0
  WIN32_DIR_BULLET    = $$WIN32_DIR_LIB\\bullet-r2552
  WIN32_DIR_BOOST     = $$WIN32_DIR_LIB\\boost_1_51_0
}

contains(DEFINES, WIN32_LINK_AUTOIMPORT) {
# message(Enabling auto import: This should work unless it involves constant data structures referencing symbols from auto-imported DLLs.)
  QMAKE_LFLAGS            = -Wl,-enable-auto-import
  QMAKE_LFLAGS_RELEASE    = -Wl,-s
  QMAKE_LFLAGS_DEBUG      =
}

contains(DEFINES, WIN32_LINK_FREEGLUT) {
# message(Statically linking freeglut)

  DEFINES += FREEGLUT_STATIC

  PATH_FREEGLUT = $$WIN32_DIR_FREEGLUT

  INCLUDEPATH += $$PATH_FREEGLUT\\include

  # include

  LIBS += -L$$PATH_FREEGLUT\\bin

  # link

  LIBS += -lfreeglut -lglu32 -lopengl32 -lwinmm -Wl,--subsystem,windows
}

contains(DEFINES, WIN32_LINK_GLEW) {
# message(Statically linking glew)

  PATH_GLEW = $$WIN32_DIR_GLEW

  INCLUDEPATH += $$PATH_GLEW\\include

  LIBS += -L$$PATH_GLEW\\lib -L$$PATH_GLEW\\lib

  LIBS += -lglew32
}

contains(DEFINES, WIN32_LINK_GLUT) {
# message(Statically linking glut)

  DEFINES += GLUT_NO_LIB_PRAGMA
  DEFINES += GLUT_NO_WARNING_DISABLE=1
  DEFINES += GLUT_DISABLE_ATEXIT_HACK

  DEFINES += D__GNUWIN32__
  DEFINES += WIN32
  DEFINES += NDEBUG
  DEFINES += _WINDOWS
  DEFINES += _MBCS

  PATH_GLUT = $$WIN32_DIR_GLUT

  INCLUDEPATH += $$PATH_GLUT

  QMAKE_CXXFLAGS_WARN_ON += -Wno-unknown-pragmas

  # include

  LIBS += -L$$PATH_GLUT

  # link

  LIBS += -lglut32 -lglu32 -lopengl32 -lwinmm -Wl,--subsystem,windows
}

contains(DEFINES, WIN32_LINK_QGLVIEWER) {
#  message(Statically linking QGLViewer)

  INCLUDEPATH += $$WIN32_DIR_QGLVIEWER

  # Link

  CONFIG( debug, debug|release ) {
    LIBS += -L$$WIN32_DIR_QGLVIEWER\\QGLViewer\\debug -lQGLViewerd2
  } else {
    LIBS += -L$$WIN32_DIR_QGLVIEWER\\QGLViewer\\release -lQGLViewer2
  }
}

contains(DEFINES, WIN32_LINK_LIB3DS) {
#  message(Statically linking lib3ds)

  DEFINES += LIB3DS_STATIC

  SRC_LIB3DS  = $$WIN32_DIR_LIB3DS

  INCLUDEPATH += $$SRC_LIB3DS

  # include

  LIBS += -L$$WIN32_DIR_LIB3DS\\lib3ds\\.libs

  # link

  LIBS += -l3ds
}

contains(DEFINES, WIN32_LINK_BULLET) {
#  message(Statically linking Bullet Physics Library)

  # c++ - gcc warning" 'will be initialized after'
  QMAKE_CXXFLAGS_WARN_ON += -Wno-reorder

  INCLUDEPATH += $$WIN32_DIR_BULLET\\src

  HEADERS += $$WIN32_DIR_BULLET\\src\\btBulletDynamicsCommon.h

  # Include

  LIBS += -L$$WIN32_DIR_BULLET\\build\\lib

  LIBS += -L$$DIR_BULLET\\Extras\\GIMPACTUtils
  LIBS += -L$$DIR_BULLET\\Extras\\HACD
  LIBS += -L$$DIR_BULLET\\src\\BulletCollision
  LIBS += -L$$DIR_BULLET\\src\\BulletDynamics
  LIBS += -L$$DIR_BULLET\\src\\BulletMultithreaded
  LIBS += -L$$DIR_BULLET\\src\\BulletSoftBody
  LIBS += -L$$DIR_BULLET\\src\\LinearMath
  LIBS += -L$$DIR_BULLET\\Extras\\Serialize\\BulletFileLoader
  LIBS += -L$$DIR_BULLET\\Extras\\Serialize\\BulletWorldImporter
  LIBS += -L$$DIR_BULLET\\Extras\\ConvexDecomposition
  LIBS += -L$$DIR_BULLET\\Extras\\LibXML
  LIBS += -L$$DIR_BULLET\\Extras\\LibXML\\include

  # Link

  LIBS += -lGIMPACTUtils
  LIBS += -lHACD
  LIBS += -lConvexDecomposition
  LIBS += -lBulletDynamics
  LIBS += -lBulletCollision
  LIBS += -lBulletMultithreaded
  LIBS += -lBulletSoftBody
  LIBS += -lLinearMath
  LIBS += -lBulletWorldImporter
  LIBS += -lBulletFileLoader
}

contains(DEFINES, WIN32_LINK_LUA) {
#  message(Statically linking LUA)

  INCLUDEPATH += $$WIN32_DIR_LUA\\include

  HEADERS += $$WIN32_DIR_LUA\\include\\lua.hpp

  # include

  LIBS += -L$$WIN32_DIR_LUA

  # link

  LIBS += -llua51
}

contains(DEFINES, WIN32_LINK_LUABIND) {
#  message(Statically linking luabind)

  DEFINES += LUABIND_DYNAMIC_LINK=1

  PATH_LUABIND = $$WIN32_DIR_LUABIND

  INCLUDEPATH += $$PATH_LUABIND

  # include

#  CONFIG( debug, debug|release ) {
    LIBS += -L$$PATH_LUABIND\\bin\\gcc-mingw-4.4.0\\release
    LIBS += -lluabind
#  } else {
#    LIBS += -L$$PATH_LUABIND\\bin\\gcc-mingw-4.4.0\\debug
#    LIBS += -lluabindd
#  }
}

contains(DEFINES, WIN32_LINK_BOOST) {
#  message(Statically linking Boost)

  INCLUDEPATH += $$WIN32_DIR_BOOST

  # include

  LIBS += -L$$WIN32_DIR_BOOST\\stage\\lib

  # link ?
}