Skip to content

Commit 6733075

Browse files
author
Simon Knopp
committed
Out with the old and in with the new
Ditched the old way of doing this (in the `old` branch) and opted for a technique that doesn't require the entire Qt source tree.
0 parents  commit 6733075

File tree

10 files changed

+1112
-0
lines changed

10 files changed

+1112
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
build

CMakeLists.txt

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
cmake_minimum_required(VERSION 3.0)
2+
project(qsqlcipher)
3+
4+
find_package(Qt5Sql REQUIRED)
5+
find_package(PkgConfig REQUIRED)
6+
pkg_check_modules(SQLCIPHER REQUIRED sqlcipher)
7+
8+
set(CMAKE_INCLUDE_CURRENT_DIR ON)
9+
set(CMAKE_AUTOMOC ON)
10+
11+
# Arrange output paths so that the plugin is found in the default search path
12+
# relative to the test binary.
13+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
14+
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/sqldrivers)
15+
16+
add_library(qsqlcipher MODULE
17+
smain.cpp
18+
qt-private/qsql_sqlite.cpp
19+
)
20+
21+
target_include_directories(qsqlcipher PRIVATE
22+
${Qt5Sql_PRIVATE_INCLUDE_DIRS}
23+
${SQLCIPHER_INCLUDE_DIRS}
24+
)
25+
26+
target_link_libraries(qsqlcipher
27+
Qt5::Sql
28+
${SQLCIPHER_LIBRARIES}
29+
)
30+
31+
add_subdirectory(test)

README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
Qt SQL driver plugin for SQLCipher
2+
==================================
3+
4+
This is a [QSqlDriverPlugin](http://doc.qt.io/qt-5/qsqldriverplugin.html) for
5+
[SQLCipher](https://www.zetetic.net/sqlcipher/open-source/). It is quite
6+
simple - it uses Qt's own SQLite driver code but links against SQLCipher
7+
instead of SQLite.
8+
9+
## Dependencies
10+
11+
- Qt 5
12+
- SQLCipher
13+
- CMake >= 3.0
14+
- pkg-config
15+
16+
17+
## Tested platforms
18+
19+
- OS X 10.10 Yosemite
20+
21+
- Qt 5.5.0 from Homebrew
22+
- SQLCipher 3.3.0 from Homebrew
23+
24+
- Ubuntu 15.04 Vivid Vervet
25+
26+
- Qt 5.4.1
27+
- SQLCipher 3.2.0
28+
- Also requires ``qtbase5-private-dev`` for Qt's private headers.
29+
30+
31+
## Deployment
32+
33+
Follow [Qt's plugin deployment guide](http://doc.qt.io/qt-5/deployment-plugins.html).
34+
In short, put the plugin at ``sqldrivers/libqsqlcipher.so`` relative to your
35+
executable.
36+
37+
-----
38+
39+
## Old version
40+
41+
This repository used to contain a different method of achieving the same
42+
result, but which required you to have the full Qt source tree available. That
43+
code is available in the ``old`` branch of this repository.
44+

qt-private/README

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
The files in this directory were copied directly from src/sql/drivers/sqlite/
2+
in the qtbase repository. Licensing information is provided at the top of
3+
each file.

0 commit comments

Comments
 (0)