summaryrefslogtreecommitdiffstats
path: root/src/sql
diff options
context:
space:
mode:
Diffstat (limited to 'src/sql')
-rw-r--r--src/sql/CMakeLists.txt100
1 files changed, 100 insertions, 0 deletions
diff --git a/src/sql/CMakeLists.txt b/src/sql/CMakeLists.txt
new file mode 100644
index 000000000..1f42df9cc
--- /dev/null
+++ b/src/sql/CMakeLists.txt
@@ -0,0 +1,100 @@
+include_directories(
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_BINARY_DIR}/include
+ ${CMAKE_SOURCE_DIR}/mkspecs/linux-g++-64
+ ${CMAKE_SOURCE_DIR}/src/sql/drivers/cache
+ ${PostgreSQL_INCLUDE_DIRS}
+ ${MYSQL_INCLUDE_DIRS}
+ ${ODBC_INCLUDE_DIRS}
+ ${FBCLIENT_INCLUDE_DIRS}
+ ${SQLITE3_INCLUDE_DIRS}
+)
+
+link_directories()
+
+
+##### sql (static)
+
+set( target sql )
+set( _SRC_ qsqlquery.cpp
+ qsqldatabase.cpp
+ qsqlfield.cpp
+ qsqlrecord.cpp
+ qsqlform.cpp
+ qsqlcursor.cpp
+ qeditorfactory.cpp
+ qsqleditorfactory.cpp
+ qsqldriver.cpp
+ qsqlextension_p.cpp
+ qsqldriverplugin.cpp
+ qsqlerror.cpp
+ qsqlresult.cpp
+ qsqlindex.cpp
+ qsqlpropertymap.cpp
+ qsqlmanager_p.cpp
+ qdatatable.cpp
+ qdataview.cpp
+ qdatabrowser.cpp
+ qsqlselectcursor.cpp
+ ./drivers/cache/qsqlcachedresult.cpp
+)
+
+set( _sql_drivers "" )
+set( _sql_libraries "" )
+
+if( WITH_SQL_DRIVER_PSQL )
+ list( APPEND _SRC_ drivers/psql/qsql_psql.cpp )
+ list( APPEND _sql_drivers "QT_SQL_POSTGRES" )
+ list( APPEND _sql_libraries ${PostgreSQL_LIBRARIES} )
+endif()
+if ( WITH_SQL_DRIVER_MYSQL )
+ list( APPEND _SRC_ drivers/mysql/qsql_mysql.cpp )
+ list( APPEND _sql_drivers "QT_SQL_MYSQL" )
+ list( APPEND _sql_libraries ${MYSQL_LIBRARIES} )
+endif()
+if( WITH_SQL_DRIVER_ODBC )
+ list( APPEND _SRC_ drivers/odbc/qsql_odbc.cpp )
+ list( APPEND _sql_drivers "QT_SQL_ODBC" )
+ list( APPEND _sql_libraries ${ODBC_LIBRARIES} )
+endif()
+if( WITH_SQL_DRIVER_IBASE )
+ list( APPEND _SRC_ drivers/ibase/qsql_ibase.cpp )
+ list( APPEND _sql_drivers "QT_SQL_IBASE" )
+ list( APPEND _sql_libraries ${FBCLIENT_LIBRARIES} )
+endif()
+if( WITH_SQL_DRIVER_SQLITE2 )
+ list( APPEND _SRC_ drivers/sqlite/qsql_sqlite.cpp )
+ list( APPEND _sql_drivers "QT_SQL_SQLITE" )
+ list( APPEND _sql_libraries ${SQLITE_LIBRARIES} )
+endif()
+if( WITH_SQL_DRIVER_SQLITE3 )
+ list( APPEND _SRC_ drivers/sqlite3/qsql_sqlite3.cpp )
+ list( APPEND _sql_drivers "QT_SQL_SQLITE3" )
+ list( APPEND _sql_libraries ${SQLITE3_LIBRARIES} )
+endif()
+
+
+tde_add_library( ${target} STATIC_PIC
+
+ SOURCES
+ ${_SRC_}
+ LINK
+ ${_sql_libraries}
+
+ DEPENDENCIES
+ tqt-includes
+)
+
+tqt_automoc( ${target}-static )
+
+list( APPEND tqtlib_embed ${target}-static )
+set( tqtlib_embed ${tqtlib_embed} PARENT_SCOPE )
+
+set_property( TARGET ${target}-static
+ APPEND PROPERTY COMPILE_DEFINITIONS
+ ${NO_XCURSOR} TQT_NO_MESSAGEBOX
+ ${_sql_drivers}
+)
+set_property( SOURCE qsql_psql.h APPEND PROPERTY COMPILE_DEFINITIONS QT_PLUGIN )