From: Ivailo Monev Date: Tue, 15 Dec 2015 21:23:15 +0000 (+0200) Subject: build sqlite drivers with bundled sqlite3 if not found on the system X-Git-Tag: 4.12.0~7721 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=caebfc6293e959bc5e93289088618ee7151931f2;p=kde%2FKatie.git build sqlite drivers with bundled sqlite3 if not found on the system Signed-off-by: Ivailo Monev --- diff --git a/src/sql/CMakeLists.txt b/src/sql/CMakeLists.txt index cba117e12..4bbd5e280 100644 --- a/src/sql/CMakeLists.txt +++ b/src/sql/CMakeLists.txt @@ -49,7 +49,7 @@ endif() if(WITH_PSQL AND PostgreSQL_FOUND) include(drivers/psql/psql.cmake) endif() -if(WITH_SQLITE AND SQLITE_FOUND) +if(WITH_SQLITE OR SQLITE_FOUND) include(drivers/sqlite/sqlite.cmake) endif() include(models/models.cmake) diff --git a/src/sql/drivers/sqlite/sqlite.cmake b/src/sql/drivers/sqlite/sqlite.cmake index 22fc6397c..f843c086f 100644 --- a/src/sql/drivers/sqlite/sqlite.cmake +++ b/src/sql/drivers/sqlite/sqlite.cmake @@ -9,13 +9,25 @@ set(SQLDRIVER_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/drivers/sqlite/qsql_sqlite.cpp ) -include_directories(${SQLITE_INCLUDE_DIRS}) +if(SQLITE_FOUND) + include_directories(${SQLITE_INCLUDE_DIRS}) +else() + set(SQLDRIVER_SOURCES + ${SQLDRIVER_SOURCES} + ${CMAKE_SOURCE_DIR}/src/3rdparty/sqlite3/sqlite3.c + ) + include_directories(${CMAKE_SOURCE_DIR}/src/3rdparty/sqlite3) +endif() katie_resources("${SQLDRIVER_SOURCES}") katie_resources("${SQLDRIVER_HEADERS}") add_library(qsqlite ${KATIE_TYPE} ${SQLDRIVER_SOURCES} ${SQLDRIVER_HEADERS}) -target_link_libraries(qsqlite KtSql ${SQLITE_LIBRARIES}) +if(SQLITE_FOUND) + target_link_libraries(qsqlite KtSql ${SQLITE_LIBRARIES}) +else() + target_link_libraries(qsqlite KtSql) +endif() install( TARGETS qsqlite