forked from sijk/qt5-sqlcipher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
40 lines (32 loc) · 967 Bytes
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
cmake_minimum_required(VERSION 3.0)
project(qsqlcipher)
find_package(Qt5Sql REQUIRED)
find_package(PkgConfig REQUIRED)
pkg_check_modules(SQLCIPHER REQUIRED sqlcipher)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
# Arrange output paths so that the plugin is found in the default search path
# relative to the test binary.
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/sqldrivers)
option(STATIC "Build plugin as a static library" OFF)
if(STATIC)
set(LIBTYPE STATIC)
add_definitions(-DQT_STATICPLUGIN)
add_subdirectory(test-static)
else()
set(LIBTYPE MODULE)
add_subdirectory(test-shared)
endif()
add_library(qsqlcipher ${LIBTYPE}
smain.cpp
qt-private/qsql_sqlite.cpp
)
target_include_directories(qsqlcipher PRIVATE
${Qt5Sql_PRIVATE_INCLUDE_DIRS}
${SQLCIPHER_INCLUDE_DIRS}
)
target_link_libraries(qsqlcipher
Qt5::Sql
${SQLCIPHER_LIBRARIES}
)