1 | # Qt sql module
|
---|
2 |
|
---|
3 | sql {
|
---|
4 |
|
---|
5 | !table {
|
---|
6 | message(table must be enabled for sql support)
|
---|
7 | REQUIRES += table
|
---|
8 | }
|
---|
9 |
|
---|
10 | SQL_P = sql
|
---|
11 | HEADERS += $$SQL_H/qsql.h \
|
---|
12 | $$SQL_H/qsqlquery.h \
|
---|
13 | $$SQL_H/qsqldatabase.h \
|
---|
14 | $$SQL_H/qsqlfield.h \
|
---|
15 | $$SQL_H/qsqlrecord.h \
|
---|
16 | $$SQL_H/qsqlcursor.h \
|
---|
17 | $$SQL_H/qsqlform.h \
|
---|
18 | $$SQL_H/qeditorfactory.h \
|
---|
19 | $$SQL_H/qsqleditorfactory.h \
|
---|
20 | $$SQL_H/qsqldriver.h \
|
---|
21 | $$SQL_P/qsqldriverinterface_p.h \
|
---|
22 | $$SQL_P/qsqlextension_p.h \
|
---|
23 | $$SQL_H/qsqldriverplugin.h \
|
---|
24 | $$SQL_H/qsqlerror.h \
|
---|
25 | $$SQL_H/qsqlresult.h \
|
---|
26 | $$SQL_H/qsqlindex.h \
|
---|
27 | $$SQL_H/qsqlpropertymap.h \
|
---|
28 | $$SQL_P/qsqlmanager_p.h \
|
---|
29 | $$SQL_H/qdatatable.h \
|
---|
30 | $$SQL_H/qdataview.h \
|
---|
31 | $$SQL_H/qdatabrowser.h \
|
---|
32 | $$SQL_H/qsqlselectcursor.h
|
---|
33 |
|
---|
34 | SOURCES += $$SQL_CPP/qsqlquery.cpp \
|
---|
35 | $$SQL_CPP/qsqldatabase.cpp \
|
---|
36 | $$SQL_CPP/qsqlfield.cpp \
|
---|
37 | $$SQL_CPP/qsqlrecord.cpp \
|
---|
38 | $$SQL_CPP/qsqlform.cpp \
|
---|
39 | $$SQL_CPP/qsqlcursor.cpp \
|
---|
40 | $$SQL_CPP/qeditorfactory.cpp \
|
---|
41 | $$SQL_CPP/qsqleditorfactory.cpp \
|
---|
42 | $$SQL_CPP/qsqldriver.cpp \
|
---|
43 | $$SQL_CPP/qsqlextension_p.cpp \
|
---|
44 | $$SQL_CPP/qsqldriverplugin.cpp \
|
---|
45 | $$SQL_CPP/qsqlerror.cpp \
|
---|
46 | $$SQL_CPP/qsqlresult.cpp \
|
---|
47 | $$SQL_CPP/qsqlindex.cpp \
|
---|
48 | $$SQL_CPP/qsqlpropertymap.cpp \
|
---|
49 | $$SQL_CPP/qsqlmanager_p.cpp \
|
---|
50 | $$SQL_CPP/qdatatable.cpp \
|
---|
51 | $$SQL_CPP/qdataview.cpp \
|
---|
52 | $$SQL_CPP/qdatabrowser.cpp \
|
---|
53 | $$SQL_CPP/qsqlselectcursor.cpp \
|
---|
54 | $$SQL_CPP/drivers/cache/qsqlcachedresult.cpp
|
---|
55 |
|
---|
56 | contains(sql-drivers, all ) {
|
---|
57 | sql-driver += psql mysql odbc oci tds db2 sqlite ibase
|
---|
58 | }
|
---|
59 |
|
---|
60 | contains(sql-drivers, psql) {
|
---|
61 | HEADERS += $$SQL_CPP/drivers/psql/qsql_psql.h
|
---|
62 | SOURCES += $$SQL_CPP/drivers/psql/qsql_psql.cpp
|
---|
63 | DEFINES += QT_SQL_POSTGRES
|
---|
64 | unix {
|
---|
65 | !contains( LIBS, .*pq.* ) {
|
---|
66 | LIBS *= -lpq
|
---|
67 | }
|
---|
68 | }
|
---|
69 | win32 {
|
---|
70 | !contains( LIBS, .*libpq.* ) {
|
---|
71 | LIBS *= libpqdll.lib
|
---|
72 | }
|
---|
73 | # win32-msvc: {
|
---|
74 | # LIBS *= delayimp.lib
|
---|
75 | # QMAKE_LFLAGS += /DELAYLOAD:libpqdll.dll
|
---|
76 | # }
|
---|
77 | # win32-borland: {
|
---|
78 | # QMAKE_LFLAGS += /dlibpqdll.dll
|
---|
79 | # }
|
---|
80 | }
|
---|
81 | }
|
---|
82 |
|
---|
83 | contains(sql-drivers, mysql) {
|
---|
84 | HEADERS += $$SQL_CPP/drivers/mysql/qsql_mysql.h
|
---|
85 | SOURCES += $$SQL_CPP/drivers/mysql/qsql_mysql.cpp
|
---|
86 | DEFINES += QT_SQL_MYSQL
|
---|
87 | unix {
|
---|
88 | !contains( LIBS, .*mysql.* ) {
|
---|
89 | LIBS *= -lmysqlclient
|
---|
90 | }
|
---|
91 | }
|
---|
92 | win32 {
|
---|
93 | !contains( LIBS, .*mysql.* ) {
|
---|
94 | LIBS *= libmysql.lib
|
---|
95 | }
|
---|
96 | # win32-msvc: {
|
---|
97 | # LIBS *= delayimp.lib
|
---|
98 | # QMAKE_LFLAGS += /DELAYLOAD:libmysql.dll
|
---|
99 | # }
|
---|
100 | # win32-borland: {
|
---|
101 | # QMAKE_LFLAGS += /dlibmysql.dll
|
---|
102 | # }
|
---|
103 | }
|
---|
104 | }
|
---|
105 |
|
---|
106 | contains(sql-drivers, odbc) {
|
---|
107 | HEADERS += $$SQL_CPP/drivers/odbc/qsql_odbc.h
|
---|
108 | SOURCES += $$SQL_CPP/drivers/odbc/qsql_odbc.cpp
|
---|
109 | DEFINES += QT_SQL_ODBC
|
---|
110 |
|
---|
111 | mac {
|
---|
112 | !contains( LIBS, .*odbc.* ) {
|
---|
113 | LIBS *= -liodbc
|
---|
114 | }
|
---|
115 | }
|
---|
116 |
|
---|
117 | cygwin-g++ {
|
---|
118 | !contains( LIBS, .*odbc.* ) {
|
---|
119 | LIBS *= -lodbc32
|
---|
120 | }
|
---|
121 | }
|
---|
122 |
|
---|
123 | unix {
|
---|
124 | !contains( LIBS, .*odbc.* ) {
|
---|
125 | LIBS *= -lodbc
|
---|
126 | }
|
---|
127 | }
|
---|
128 |
|
---|
129 | win32 {
|
---|
130 | !win32-borland:LIBS *= odbc32.lib
|
---|
131 | win32-borland:LIBS *= $(BCB)/lib/PSDK/odbc32.lib
|
---|
132 | }
|
---|
133 |
|
---|
134 | }
|
---|
135 |
|
---|
136 | contains(sql-drivers, oci) {
|
---|
137 | HEADERS += $$SQL_CPP/drivers/oci/qsql_oci.h
|
---|
138 | SOURCES += $$SQL_CPP/drivers/oci/qsql_oci.cpp
|
---|
139 | DEFINES += QT_SQL_OCI
|
---|
140 | unix {
|
---|
141 | !contains( LIBS, .*clnts.* ) {
|
---|
142 | LIBS += -lclntsh -lwtc8
|
---|
143 | }
|
---|
144 | }
|
---|
145 | win32 {
|
---|
146 | LIBS += oci.lib
|
---|
147 | # win32-msvc: {
|
---|
148 | # LIBS *= delayimp.lib
|
---|
149 | # QMAKE_LFLAGS += /DELAYLOAD:oci.dll
|
---|
150 | # }
|
---|
151 | # win32-borland: {
|
---|
152 | # QMAKE_LFLAGS += /doci.dll
|
---|
153 | # }
|
---|
154 | }
|
---|
155 | }
|
---|
156 |
|
---|
157 | contains(sql-drivers, tds) {
|
---|
158 | HEADERS += $$SQL_CPP/drivers/tds/qsql_tds.h \
|
---|
159 | $$SQL_CPP/drivers/shared/qsql_result.h
|
---|
160 | SOURCES += $$SQL_CPP/drivers/tds/qsql_tds.cpp \
|
---|
161 | $$SQL_CPP/drivers/shared/qsql_result.cpp
|
---|
162 | DEFINES += QT_SQL_TDS
|
---|
163 | unix {
|
---|
164 | LIBS += -L$SYBASE/lib -lsybdb
|
---|
165 | }
|
---|
166 | win32 {
|
---|
167 | !win32-borland:LIBS += NTWDBLIB.LIB
|
---|
168 | win32-borland:LIBS += $(BCB)/lib/PSDK/NTWDBLIB.LIB
|
---|
169 | # win32-msvc: {
|
---|
170 | # LIBS *= delayimp.lib
|
---|
171 | # QMAKE_LFLAGS += /DELAYLOAD:ntwdblib.dll
|
---|
172 | # }
|
---|
173 | # win32-borland: {
|
---|
174 | # QMAKE_LFLAGS += /dntwdblib.dll
|
---|
175 | # }
|
---|
176 | }
|
---|
177 | }
|
---|
178 |
|
---|
179 | contains(sql-drivers, db2) {
|
---|
180 | HEADERS += $$SQL_CPP/drivers/db2/qsql_db2.h
|
---|
181 | SOURCES += $$SQL_CPP/drivers/db2/qsql_db2.cpp
|
---|
182 | DEFINES += QT_SQL_DB2
|
---|
183 | unix {
|
---|
184 | LIBS += -ldb2
|
---|
185 | }
|
---|
186 | win32 {
|
---|
187 | !win32-borland:LIBS += db2cli.lib
|
---|
188 | # win32-borland:LIBS += $(BCB)/lib/PSDK/db2cli.lib
|
---|
189 | }
|
---|
190 | }
|
---|
191 |
|
---|
192 | contains(sql-drivers, ibase) {
|
---|
193 | HEADERS += $$SQL_CPP/drivers/ibase/qsql_ibase.h
|
---|
194 | SOURCES += $$SQL_CPP/drivers/ibase/qsql_ibase.cpp
|
---|
195 | DEFINES += QT_SQL_IBASE
|
---|
196 | unix {
|
---|
197 | LIBS *= -lgds
|
---|
198 | }
|
---|
199 | win32 {
|
---|
200 | !win32-borland:LIBS *= gds32_ms.lib
|
---|
201 | win32-borland:LIBS += gds32.lib
|
---|
202 | }
|
---|
203 | }
|
---|
204 |
|
---|
205 | contains(sql-drivers, sqlite) {
|
---|
206 | !contains( LIBS, .*sqlite.* ) {
|
---|
207 |
|
---|
208 | INCLUDEPATH += $$SQL_CPP/../3rdparty/sqlite/
|
---|
209 |
|
---|
210 | HEADERS += $$SQL_CPP/../3rdparty/sqlite/btree.h \
|
---|
211 | $$SQL_CPP/../3rdparty/sqlite/config.h \
|
---|
212 | $$SQL_CPP/../3rdparty/sqlite/hash.h \
|
---|
213 | $$SQL_CPP/../3rdparty/sqlite/opcodes.h \
|
---|
214 | $$SQL_CPP/../3rdparty/sqlite/os.h \
|
---|
215 | $$SQL_CPP/../3rdparty/sqlite/pager.h \
|
---|
216 | $$SQL_CPP/../3rdparty/sqlite/parse.h \
|
---|
217 | $$SQL_CPP/../3rdparty/sqlite/sqlite.h \
|
---|
218 | $$SQL_CPP/../3rdparty/sqlite/sqliteInt.h \
|
---|
219 | $$SQL_CPP/../3rdparty/sqlite/vdbe.h \
|
---|
220 | $$SQL_CPP/../3rdparty/sqlite/vdbeInt.h
|
---|
221 |
|
---|
222 | SOURCES += $$SQL_CPP/../3rdparty/sqlite/attach.c \
|
---|
223 | $$SQL_CPP/../3rdparty/sqlite/auth.c \
|
---|
224 | $$SQL_CPP/../3rdparty/sqlite/btree.c \
|
---|
225 | $$SQL_CPP/../3rdparty/sqlite/btree_rb.c \
|
---|
226 | $$SQL_CPP/../3rdparty/sqlite/build.c \
|
---|
227 | $$SQL_CPP/../3rdparty/sqlite/copy.c \
|
---|
228 | $$SQL_CPP/../3rdparty/sqlite/date.c \
|
---|
229 | $$SQL_CPP/../3rdparty/sqlite/delete.c \
|
---|
230 | $$SQL_CPP/../3rdparty/sqlite/expr.c \
|
---|
231 | $$SQL_CPP/../3rdparty/sqlite/func.c \
|
---|
232 | $$SQL_CPP/../3rdparty/sqlite/hash.c \
|
---|
233 | $$SQL_CPP/../3rdparty/sqlite/insert.c \
|
---|
234 | $$SQL_CPP/../3rdparty/sqlite/main.c \
|
---|
235 | $$SQL_CPP/../3rdparty/sqlite/opcodes.c \
|
---|
236 | $$SQL_CPP/../3rdparty/sqlite/os.c \
|
---|
237 | $$SQL_CPP/../3rdparty/sqlite/pager.c \
|
---|
238 | $$SQL_CPP/../3rdparty/sqlite/parse.c \
|
---|
239 | $$SQL_CPP/../3rdparty/sqlite/pragma.c \
|
---|
240 | $$SQL_CPP/../3rdparty/sqlite/printf.c \
|
---|
241 | $$SQL_CPP/../3rdparty/sqlite/random.c \
|
---|
242 | $$SQL_CPP/../3rdparty/sqlite/select.c \
|
---|
243 | $$SQL_CPP/../3rdparty/sqlite/shell.c \
|
---|
244 | $$SQL_CPP/../3rdparty/sqlite/table.c \
|
---|
245 | $$SQL_CPP/../3rdparty/sqlite/tokenize.c \
|
---|
246 | $$SQL_CPP/../3rdparty/sqlite/trigger.c \
|
---|
247 | $$SQL_CPP/../3rdparty/sqlite/update.c \
|
---|
248 | $$SQL_CPP/../3rdparty/sqlite/util.c \
|
---|
249 | $$SQL_CPP/../3rdparty/sqlite/vacuum.c \
|
---|
250 | $$SQL_CPP/../3rdparty/sqlite/vdbe.c \
|
---|
251 | $$SQL_CPP/../3rdparty/sqlite/vdbeaux.c \
|
---|
252 | $$SQL_CPP/../3rdparty/sqlite/where.c
|
---|
253 | }
|
---|
254 |
|
---|
255 | HEADERS += $$SQL_CPP/drivers/sqlite/qsql_sqlite.h
|
---|
256 | SOURCES += $$SQL_CPP/drivers/sqlite/qsql_sqlite.cpp
|
---|
257 | DEFINES += QT_SQL_SQLITE
|
---|
258 | }
|
---|
259 | }
|
---|
260 |
|
---|