src/sql/drivers/drivers.pri
changeset 0 1918ee327afb
child 7 3f74d0d4af4c
equal deleted inserted replaced
-1:000000000000 0:1918ee327afb
       
     1 contains(sql-drivers, all ) {
       
     2     sql-driver +=   psql mysql odbc oci tds db2 sqlite ibase
       
     3 }
       
     4 
       
     5 contains(sql-drivers, psql) {
       
     6     HEADERS +=      drivers/psql/qsql_psql.h
       
     7     SOURCES +=      drivers/psql/qsql_psql.cpp
       
     8 
       
     9     unix {
       
    10         !isEmpty(QT_LFLAGS_PSQL) {
       
    11             LIBS *= $$QT_LFLAGS_PSQL
       
    12             QMAKE_CXXFLAGS *= $$QT_CFLAGS_PSQL
       
    13         }
       
    14         !contains(LIBS, .*pq.*):LIBS *= -lpq
       
    15     }
       
    16 
       
    17     win32 {
       
    18 	!win32-g++:!contains( LIBS, .*pq.* ):LIBS *= -llibpq
       
    19     	win32-g++:!contains( LIBS, .*pq.* ):LIBS *= -lpq
       
    20         LIBS *= -lws2_32 -ladvapi32
       
    21     }
       
    22 }
       
    23 
       
    24 contains(sql-drivers, mysql) {
       
    25     HEADERS +=      drivers/mysql/qsql_mysql.h
       
    26     SOURCES +=      drivers/mysql/qsql_mysql.cpp
       
    27 
       
    28     unix {
       
    29         isEmpty(QT_LFLAGS_MYSQL) {
       
    30             !contains(LIBS, .*mysqlclient.*):!contains(LIBS, .*mysqld.*) {
       
    31                 use_libmysqlclient_r:LIBS *= -lmysqlclient_r
       
    32                 else:LIBS *= -lmysqlclient
       
    33             }
       
    34         } else {
       
    35             LIBS *= $$QT_LFLAGS_MYSQL
       
    36             QMAKE_CXXFLAGS *= $$QT_CFLAGS_MYSQL
       
    37         }
       
    38     }
       
    39 
       
    40     win32:!contains(LIBS, .*mysql.*):!contains(LIBS, .*mysqld.*) {
       
    41         !win32-g++:LIBS     *= -llibmysql    
       
    42 	win32-g++:LIBS	    *= -lmysql
       
    43     }    
       
    44 }
       
    45 
       
    46 contains(sql-drivers, odbc) {
       
    47      HEADERS += drivers/odbc/qsql_odbc.h
       
    48      SOURCES += drivers/odbc/qsql_odbc.cpp
       
    49 
       
    50      mac:!contains( LIBS, .*odbc.* ):LIBS        *= -liodbc
       
    51      unix:!contains( LIBS, .*odbc.* ):LIBS       *= -lodbc
       
    52 
       
    53      win32 {
       
    54          !win32-borland:LIBS     *= -lodbc32
       
    55          win32-borland:LIBS      *= $(BCB)/lib/PSDK/odbc32.lib
       
    56      }
       
    57 }
       
    58 
       
    59 contains(sql-drivers, oci) {
       
    60     HEADERS += drivers/oci/qsql_oci.h
       
    61     SOURCES += drivers/oci/qsql_oci.cpp
       
    62 
       
    63     unix:!contains( LIBS, .*clnts.* ):LIBS += -lclntsh
       
    64 
       
    65     win32:LIBS += -loci
       
    66 }
       
    67 
       
    68 contains(sql-drivers, tds) {
       
    69     HEADERS += drivers/tds/qsql_tds.h
       
    70     SOURCES += drivers/tds/qsql_tds.cpp
       
    71 
       
    72     unix:LIBS += -L$SYBASE/lib -lsybdb
       
    73 
       
    74     win32 {
       
    75         !win32-borland:LIBS += -lNTWDBLIB
       
    76         win32-borland:LIBS += $(BCB)/lib/PSDK/NTWDBLIB.LIB
       
    77     }
       
    78 }
       
    79 
       
    80 contains(sql-drivers, db2) {
       
    81     HEADERS += drivers/db2/qsql_db2.h
       
    82     SOURCES += drivers/db2/qsql_db2.cpp
       
    83     
       
    84     unix:LIBS += -ldb2
       
    85     
       
    86     win32 {
       
    87         !win32-borland:LIBS += -ldb2cli
       
    88 #        win32-borland:LIBS  += $(BCB)/lib/PSDK/db2cli.lib
       
    89     }
       
    90 }
       
    91 
       
    92 contains(sql-drivers, ibase) {
       
    93     HEADERS += drivers/ibase/qsql_ibase.h
       
    94     SOURCES += drivers/ibase/qsql_ibase.cpp
       
    95     
       
    96     unix:LIBS *= -lgds  
       
    97     
       
    98     win32 {
       
    99         !win32-borland:LIBS *= -lgds32_ms
       
   100         win32-borland:LIBS  += gds32.lib
       
   101     }
       
   102 }
       
   103 
       
   104 contains(sql-drivers, sqlite2) {
       
   105     HEADERS += drivers/sqlite2/qsql_sqlite2.h
       
   106     SOURCES += drivers/sqlite2/qsql_sqlite2.cpp
       
   107     !contains(LIBS, .*sqlite.*):LIBS *= -lsqlite
       
   108 }
       
   109 
       
   110 contains(sql-drivers, sqlite) {
       
   111     !system-sqlite:!contains( LIBS, .*sqlite3.* ) {
       
   112         CONFIG(release, debug|release):DEFINES *= NDEBUG
       
   113         DEFINES += SQLITE_OMIT_LOAD_EXTENSION SQLITE_OMIT_COMPLETE 
       
   114         INCLUDEPATH +=  ../3rdparty/sqlite
       
   115         SOURCES +=      ../3rdparty/sqlite/sqlite3.c
       
   116     } else {
       
   117         LIBS *= $$QT_LFLAGS_SQLITE
       
   118         QMAKE_CXXFLAGS *= $$QT_CFLAGS_SQLITE
       
   119     }
       
   120 
       
   121     HEADERS +=      drivers/sqlite/qsql_sqlite.h
       
   122     SOURCES +=      drivers/sqlite/qsql_sqlite.cpp
       
   123 }