forked from gee-whiz/qboard
/
config.qmake
251 lines (232 loc) · 7.32 KB
/
config.qmake
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
########################################################################
# This is the main "dynamic configuration" qmake code for the QBoard
# project.
#
# As a normal user, you "shouldn't" have to touch any variables in
# this file except maybe to turn on/off OpenGL support (grep this file
# for 'opengl').
########################################################################
# Maintainer's notes:
#
# This file is unfortunately not usable by .pro-file-based IDEs
# (e.g. Edyuk and QDevelop) because it uses qmake constructs which (as
# of this writing) those tools choke on.
#
# It is important that all QBoard qmake code not use ANY platform-specific
# commands (e.g. $$system(date)). While the code is currently untested
# on Windows, building it there is a priority. The obligatory exception
# to this rule is the use of platform scopes provided by qmake, e.g.:
#
# unix { ... }
#
# But of course those sections should not contain any code which is
# necessary for the build process on other platforms.
#
# QMake is nice in its own way, but it it very limited it what we can
# do with it. We do not have the expressive power of Make on Unix
# platforms. Try and keep that in mind when using/editing this code
# (remembering it saves some degree of frustration).
#
########################################################################
# QBOARD_VERSION should be set to 0 here, or a date integer in YYYYMMDD
# format. The source will convert 0 to "SVN" (or similar), otherwise it will
# use the number as-is.
# i'd rather use %Y.%m.%d as QBOARD_VERSION, but apparently it's
# impossible to reliably escape that to a string from here. i had it
# working once and qdevelop hosed the quoting when it re-saved the
# .pro file.
QBOARD_VERSION = 0
#!$$QBOARD_VERSION {
# QMAKE_CXX = colorgcc # xemacs doesn't like the escape codes
#}
QBOARD_CONF = config.qmake # THIS file
TOP_SRCDIR=$$PWD
!exists($$TOP_SRCDIR/$$QBOARD_CONF) {
error("to fix this, edit $$QBOARD_CONF and set the variable TOP_SRCDIR to the \
absolute path of the top-most directory of this source tree (the dir \
containing $$QBOARD_CONF)")
}
########################################################################
# Construct a relative dir to the root. This won't work for TOP_SRCDIR,
# or at least it's untested.
REL_SRCDIR = $$(PWD)
REL_SRCDIR=$$replace(REL_SRCDIR,$$TOP_SRCDIR/,)
REL_SRCDIR=$$replace(REL_SRCDIR,[^/]+,..)
CONFIG += warn_on debug no_keywords
VERSION = $$QBOARD_VERSION
message(QBoard version $$QBOARD_VERSION)
message(QT_VERSION $$QT_VERSION)
RESOURCES_DIR = $$REL_SRCDIR/resources
UI_SRCDIR = $$REL_SRCDIR/ui
UI_DIR = $$REL_SRCDIR/build/$$QT_VERSION
OBJECTS_DIR = $$REL_SRCDIR/build/$$QT_VERSION
DESTDIR = $$REL_SRCDIR/bin/$$QT_VERSION
# DLLDESTDIR = $$DESTDIR/plugins
QBOARD_PLUGINS_DESTDIR = $$DESTDIR/plugins
MOC_DIR = $$REL_SRCDIR/build/$$QT_VERSION
SRC_DIR = $$REL_SRCDIR/src
S11N_DIR = $$REL_SRCDIR/s11n
# S11N_INCLUDES = -I$$S11N_DIR/include
MAIN_INCLUDES_DIR = $$REL_SRCDIR/include
QBOARD_INCLUDES_DIR = $$MAIN_INCLUDES_DIR/qboard
S11N_CXXFLAGS = -I$$MAIN_INCLUDES_DIR
S11N_OBJ_DIR = $$OBJECTS_DIR/s11n
# QBOARD_INCLUDES = -I$$REL_SRCDIR/src -I$$MOC_DIR -I$$UI_DIR
QMAKE_INCDIR += $$SRC_DIR
# DEFINES += QT_DLL
# INCLUDES += $$QBOARD_INCLUDES
########################################################################
# S11N_xxx have to do with the libs11n code.
S11N_DIR = $$REL_SRCDIR/s11n
S11N_SOURCES_CORE = \
$$S11N_DIR/data_node_io.cpp \
$$S11N_DIR/exception.cpp \
$$S11N_DIR/path_finder.cpp \
$$S11N_DIR/plugin.cpp \
$$S11N_DIR/s11n.cpp \
$$S11N_DIR/s11n_node.cpp \
$$S11N_DIR/s11nlite.cpp \
$$S11N_DIR/strtool.cpp \
$$S11N_DIR/zfstream.cpp
S11N_SOURCES_SERIALIZERS = \
$$S11N_DIR/funtxt.flex.cpp \
$$S11N_DIR/funtxt_serializer.cpp \
$$S11N_DIR/funxml.flex.cpp \
$$S11N_DIR/funxml_serializer.cpp \
$$S11N_DIR/js_serializer.cpp \
$$S11N_DIR/parens.flex.cpp \
$$S11N_DIR/parens_serializer.cpp
unix:{
S11N_SOURCES_CORE += $$S11N_DIR/gzstream.cpp
QMAKE_LFLAGS += -lz
S11N_CXXFLAGS += -DHAVE_ZLIB=1
}
S11N_SOURCES = $$S11N_SOURCES_CORE \
$$S11N_SOURCES_SERIALIZERS
S11N_DIR=
S11N_OBJECTS=
unix:DOT_OBJ=.o
win32:DOT_OBJ=.obj
for(CPP, S11N_SOURCES){
BASENAME = $$basename(CPP)
S11N_OBJECTS += $$S11N_OBJ_DIR/$$replace(BASENAME,.cpp,$$DOT_OBJ)
}
message( S11N_OBJECTS=$$S11N_OBJECTS )
########################################################################
# For Qt 4.4 we add some bits which aren't available in 4.3...
contains(QT_VERSION, ^4\.(4|5|6)\..+ ){
message("Adding Qt 4.4+-specific bits")
QBOARD_HEADERS_QT44 = $$QBOARD_INCLUDES_DIR/QBoardDocsBrowser.h
QBOARD_SOURCES_QT44 = $$SRC_DIR/QBoardDocsBrowser.cpp
QBOARD_FORMS_QT44 = $$UI_SRCDIR/QBoardDocsBrowser.ui
QBOARD_QT44 = webkit
}
QT = core gui script $$QBOARD_QT44
# FIXME: how to determine dynamically whether to enable OpenGL here?
QT += opengl
contains(QT,opengl){
#DEFINES += QBOARD_USE_OPENGL=1
message(Enabling OpenGL support.)
}
!contains(QT,opengl){
#DEFINES += QBOARD_USE_OPENGL=0
message(Disabling OpenGL support.)
}
########################################################################
# S11nQt stuff...
H=$$QBOARD_INCLUDES_DIR
S11NQT_HEADERS = \
$$H/Serializable.h \
$$H/S11n.h \
$$H/S11nQt/S11nClipboard.h \
$$H/S11nQt.h
H=
S11NQT_SOURCES = \
$$SRC_DIR/S11nClipboard.cpp \
$$SRC_DIR/S11nQt.cpp \
$$SRC_DIR/S11nQtStream.cpp \
$$SRC_DIR/Serializable.cpp
S11NQT_OBJECTS =
for(CPP, S11NQT_SOURCES){
BASENAME = $$basename(CPP)
S11NQT_OBJECTS += $$OBJECTS_DIR/$$replace(BASENAME,.cpp,$$DOT_OBJ)
}
########################################################################
# If/when we ever refactor QBoard into lib+app, these headers belong
# in the lib:
H=$$QBOARD_INCLUDES_DIR
QBOARD_HEADERS_LIB = \
$$QBOARD_HEADERS_QT44 \
$$S11NQT_HEADERS \
$$H/Dice.h \
$$H/GameState.h \
$$H/GL.h \
$$H/JSGameState.h \
$$H/JSQBoardView.h \
$$H/JSQGI.h \
$$H/MenuHandlerBoard.h \
$$H/MenuHandlerGeneric.h \
$$H/PieceAppearanceWidget.h \
$$H/PathFinder.h \
$$H/PropObj.h \
$$H/ScriptQt.h \
$$H/QBoard.h \
$$H/QBoardHomeView.h \
$$H/QBoardPlugin.h \
$$H/QBoardScene.h \
$$H/QBoardView.h \
$$H/QGI.h \
$$H/QGIDot.h \
$$H/QGIHider.h \
$$H/QGIHtml.h \
$$H/QGILine.h \
$$H/QGIPiece.h \
$$H/QGIPiecePlacemarker.h \
$$H/utility.h \
$$H/WikiLiteParser.h \
$$H/WikiLiteView.h
H=
S=$$SRC_DIR
QBOARD_SOURCES_LIB = \
$$QBOARD_SOURCES_QT44 \
$$S11NQT_SOURCES \
$$S/Dice.cpp \
$$S/GameState.cpp \
$$S/JSGameState.cpp \
$$S/JSQBoardView.cpp \
$$S/JSQGI.cpp \
$$S/MenuHandlerBoard.cpp \
$$S/MenuHandlerGeneric.cpp \
$$S/PieceAppearanceWidget.cpp \
$$S/PathFinder.cpp \
$$S/PropObj.cpp \
$$S/ScriptQt.cpp \
$$S/QBoard.cpp \
$$S/QBoardHomeView.cpp \
$$S/QBoardPlugin.cpp \
$$S/QBoardScene.cpp \
$$S/QBoardView.cpp \
$$S/QGI.cpp \
$$S/QGIDot.cpp \
$$S/QGIHider.cpp \
$$S/QGIHtml.cpp \
$$S/QGILine.cpp \
$$S/QGIPiece.cpp \
$$S/QGIPiecePlacemarker.cpp \
$$S/utility.cpp \
$$S/WikiLiteParser.cpp \
$$S/WikiLiteView.cpp
S=
QBOARD_OBJECTS_LIB =
for(CPP, QBOARD_SOURCES_LIB){
BASENAME = $$basename(CPP)
QBOARD_OBJECTS_LIB += $$OBJECTS_DIR/$$replace(BASENAME,.cpp,$$DOT_OBJ)
}
#QBOARD_SOURCES_GAMESETS =
#QBOARD_HEADERS_GAMESETS =
#QBOARD_LIBS = -L$$DESTDIR -lQBoard -L$$DESTDIR -lQBoardS11n
QBOARD_LIBS = -L$$DESTDIR -lQBoard # -L$$DESTDIR -lQBoardS11n
INCLUDEPATH += $$MAIN_INCLUDES_DIR
# QBOARD_INCLUDES = -I$$MAIN_INCLUDES_DIR
QBOARD_CXXFLAGS = $$S11N_CXXFLAGS -DQBOARD_VERSION=$$QBOARD_VERSION
# x