summaryrefslogtreecommitdiffstats
path: root/src/plugins/sqldrivers
diff options
context:
space:
mode:
authorAlbert Astals Cid <albert.astals.cid@kdab.com>2019-02-12 14:55:20 +0100
committerAlbert Astals Cid <albert.astals.cid@kdab.com>2019-02-12 14:39:50 +0000
commit0a14d13b3082bb245ddbb839e15025b9709f4eff (patch)
tree776c2cada53c51caeb073029e314fea4f6c74129 /src/plugins/sqldrivers
parent11acba6504560dde54e94989b84df94157f9cc00 (diff)
cmake: Find and build odbc plugin
Change-Id: I479d2b1cc897f601ef68b10272c9396e52228201 Reviewed-by: Liang Qi <liang.qi@qt.io>
Diffstat (limited to 'src/plugins/sqldrivers')
-rw-r--r--src/plugins/sqldrivers/CMakeLists.txt2
-rw-r--r--src/plugins/sqldrivers/configure.cmake4
-rw-r--r--src/plugins/sqldrivers/odbc/CMakeLists.txt32
3 files changed, 36 insertions, 2 deletions
diff --git a/src/plugins/sqldrivers/CMakeLists.txt b/src/plugins/sqldrivers/CMakeLists.txt
index cc39a0fe35..1676396f3a 100644
--- a/src/plugins/sqldrivers/CMakeLists.txt
+++ b/src/plugins/sqldrivers/CMakeLists.txt
@@ -23,7 +23,7 @@ if(QT_FEATURE_sql_mysql)
endif()
if(QT_FEATURE_sql_odbc)
-# TODO add_subdirectory(odbc)
+ add_subdirectory(odbc)
endif()
if(QT_FEATURE_sql_tds)
diff --git a/src/plugins/sqldrivers/configure.cmake b/src/plugins/sqldrivers/configure.cmake
index 8b349a160d..41a66197d1 100644
--- a/src/plugins/sqldrivers/configure.cmake
+++ b/src/plugins/sqldrivers/configure.cmake
@@ -8,6 +8,8 @@
find_package(PostgreSQL)
set_package_properties(PostgreSQL PROPERTIES TYPE OPTIONAL)
+find_package(ODBC)
+set_package_properties(ODBC PROPERTIES TYPE OPTIONAL)
find_package(SQLite3)
set_package_properties(SQLite3 PROPERTIES TYPE OPTIONAL)
@@ -36,7 +38,7 @@ qt_feature("sql_oci" PRIVATE
)
qt_feature("sql_odbc" PRIVATE
LABEL "ODBC"
- CONDITION QT_FEATURE_datestring AND libs.odbc OR FIXME
+ CONDITION QT_FEATURE_datestring AND ODBC_FOUND
)
qt_feature("sql_psql" PRIVATE
LABEL "PostgreSQL"
diff --git a/src/plugins/sqldrivers/odbc/CMakeLists.txt b/src/plugins/sqldrivers/odbc/CMakeLists.txt
new file mode 100644
index 0000000000..792edb4c82
--- /dev/null
+++ b/src/plugins/sqldrivers/odbc/CMakeLists.txt
@@ -0,0 +1,32 @@
+# Generated from odbc.pro.
+
+find_package(ODBC)
+
+#####################################################################
+## qsqlodbc Plugin:
+#####################################################################
+
+add_qt_plugin(qsqlodbc
+ TYPE sqldrivers
+ SOURCES
+ main.cpp
+ qsql_odbc.cpp qsql_odbc_p.h
+ DEFINES
+ QT_NO_CAST_TO_ASCII
+ QT_NO_CAST_FROM_ASCII
+ LIBRARIES
+ Qt::CorePrivate
+ Qt::SqlPrivate
+ ODBC::ODBC
+ # OTHER_FILES = "odbc.json"
+ # PLUGIN_CLASS_NAME = "QODBCDriverPlugin"
+ # _LOADED = "qt_plugin"
+)
+
+## Scopes:
+#####################################################################
+
+extend_target(qsqlodbc CONDITION UNIX
+ DEFINES
+ UNICODE
+)