Skip to content

Commit

Permalink
QSqlite3: fix build with Qt 5.7
Browse files Browse the repository at this point in the history
Use ${QtSql_PRIVATE_INCLUDE_DIRS} to include the private headers
directly from current Qt install instead of carrying a local copy.
  • Loading branch information
danvratil committed Jun 5, 2016
1 parent 0af638c commit 068c0bd
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 638 deletions.
10 changes: 8 additions & 2 deletions CMakeLists.txt
Expand Up @@ -33,7 +33,13 @@ ecm_setup_version(${AKONADI_VERSION}
SOVERSION 5)

# Find packages
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED DBus Gui Network Sql Test Widgets Xml)
find_package(Qt5Core ${QT_REQUIRED_VERSION} REQUIRED COMPONENTS Private)
find_package(Qt5Sql ${QT_REQUIRED_VERSION} REQUIRED COMPONENTS Private)
find_package(Qt5DBus ${QT_REQUIRED_VERSION} REQUIRED)
find_package(Qt5Network ${QT_REQUIRED_VERSION} REQUIRED)
find_package(Qt5Test ${QT_REQUIRED_VERSION} REQUIRED)
find_package(Qt5Widgets ${QT_REQUIRED_VERSION} REQUIRED)
find_package(Qt5Xml ${QT_REQUIRED_VERSION} REQUIRED)

find_package(KF5Completion ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5Config ${KF5_VERSION} CONFIG REQUIRED)
Expand Down Expand Up @@ -129,7 +135,7 @@ else()
set(SQLITE_TYPE "OPTIONAL")
endif()

if(AKONADI_BUILD_QSQLITE AND Qt5Core_VERSION VERSION_LESS 5.7.0) # API change in 5.7 breaks our sqlite driver
if(AKONADI_BUILD_QSQLITE)
set(SQLITE_MIN_VERSION 3.6.23)
find_package(Sqlite ${SQLITE_MIN_VERSION})
set_package_properties(Sqlite PROPERTIES
Expand Down
2 changes: 2 additions & 0 deletions src/qsqlite/CMakeLists.txt
Expand Up @@ -9,6 +9,8 @@ message(STATUS "Building QSQLITE3 driver")
set(QSQLITE_INSTALL_PREFIX "${PLUGIN_INSTALL_DIR}/sqldrivers")

include_directories(
${Qt5Core_PRIVATE_INCLUDE_DIRS}
${Qt5Sql_PRIVATE_INCLUDE_DIRS}
${CMAKE_CURRENT_SOURCE_DIR}/src
${SQLITE_INCLUDE_DIR}
)
Expand Down

0 comments on commit 068c0bd

Please sign in to comment.