summaryrefslogtreecommitdiffstats
path: root/src/sql
diff options
context:
space:
mode:
authorgregory guy <gregory-tde@laposte.net>2021-03-15 15:32:40 +0100
committerSlávek Banko <slavek.banko@axis.cz>2024-03-02 18:52:12 +0100
commit12bd9b6b2bba50da9c3444dfb42b985ed2a6a7c1 (patch)
tree8319b9e98b3fa1f2a2a61d7719eb9a714c7ad66a /src/sql
parent34587584ab80fd696cc9d73dda1326f175125ddf (diff)
downloadtqt3-12bd9b6b2bba50da9c3444dfb42b985ed2a6a7c1.tar.gz
tqt3-12bd9b6b2bba50da9c3444dfb42b985ed2a6a7c1.zip
Conversion to the cmake building system.feat/cmakeConv
Signed-off-by: gregory guy <gregory-tde@laposte.net> Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
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 )