[Digikam-devel] [Bug 237037] New: digikam sqlite convience copy
Mark Purcell
msp at debian.org
Sun May 9 22:54:14 BST 2010
https://bugs.kde.org/show_bug.cgi?id=237037
Summary: digikam sqlite convience copy
Product: digikam
Version: 1.2.0
Platform: unspecified
OS/Version: Linux
Status: UNCONFIRMED
Severity: normal
Priority: NOR
Component: general
AssignedTo: digikam-devel at kde.org
ReportedBy: msp at debian.org
Version: 1.2.0 (using 4.4.3 (KDE 4.4.3), Debian packages)
Compiler: cc
OS: Linux (x86_64) release 2.6.32-5-amd64
With Cmake, digikam no longer checks for a system version of sqlite (original
report http://bugs.kde.org/show_bug.cgi?id=160966#c65)
It would be good for digikam during build to check and see if there is a system
installed sqlite library of the correct version and build/ link against that,
rather than the internal copy of that lib.
By doing this system resources are saved by linking to shared libs and security
issues/ bugs in libs only need to be fixed in one location rather than all the
applications which may or may not embed copies.
Find attached half the patch to check for an installed sqlite, the patch fails
during linking with libdigikamdatabase.
Mark
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -187,6 +187,11 @@ MACRO_BOOL_TO_01(GLIB2_FOUND HAVE_GLIB2)
MACRO_OPTIONAL_FIND_PACKAGE(Lqr-1)
MACRO_BOOL_TO_01(LQR-1_FOUND USE_EXT_LIBLQR-1)
+MACRO_OPTIONAL_FIND_PACKAGE(Sqlite)
+MACRO_BOOL_TO_01(SQLITE_FOUND USE_EXT_SQLITE)
+PKG_CHECK_MODULES(Sqlite sqlite3>=3.5.9)
+
+
MACRO_BOOL_TO_01(ENABLE_THUMBS_DB USE_THUMBS_DB)
IF (${KDE_VERSION} VERSION_GREATER "4.2.70")
@@ -301,6 +306,12 @@ ELSE(GLIB2_FOUND)
MESSAGE(STATUS "")
ENDIF(GLIB2_FOUND)
+IF(SQLITE_FOUND)
+ MESSAGE(STATUS " libsqlite library found ................. YES
(optional)")
+ELSE(SQLITE_FOUND)
+ MESSAGE(STATUS " libsqlite library found ................. NO (optional -
internal version used instead)")
+ ENDIF(SQLITE_FOUND)
+
IF(DOXYGEN_FOUND)
MESSAGE(STATUS " Doxygen found............................ YES
(optional)")
ELSE(DOXYGEN_FOUND)
@@ -961,40 +972,55 @@ IF(DIGIKAM_CAN_BE_COMPILED)
${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/libpgf/WaveletTransform.cpp
)
- SET(libsqlite2_SRCS
- ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/attach.c
- ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/auth.c
- ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/btree.c
- ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/btree_rb.c
- ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/build.c
- ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/copy.c
- ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/date.c
- ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/delete.c
- ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/encode.c
- ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/expr.c
- ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/func.c
- ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/hash.c
- ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/insert.c
- ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/main.c
- ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/opcodes.c
- ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/os.c
- ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/pager.c
- ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/parse.c
- ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/pragma.c
- ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/printf.c
- ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/random.c
- ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/select.c
- ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/shell.c
- ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/table.c
- ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/tokenize.c
- ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/trigger.c
- ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/update.c
- ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/util.c
- ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/vacuum.c
- ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/vdbe.c
- ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/vdbeaux.c
- ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/where.c
- )
+ #
=================================================================================================
+ # Sqlite library rules
+
+ IF(SQLITE_FOUND)
+
+ INCLUDE_DIRECTORIES(${SQLITE_INCLUDE_DIRS})
+ SET(sqlite_LIBS ${SQLITE_LIBRARIES})
+
+ ELSE(SQLITE_FOUND)
+
+ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty)
+
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2)
+
+ SET(libsqlite2_SRCS
+ ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/attach.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/auth.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/btree.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/btree_rb.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/build.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/copy.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/date.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/delete.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/encode.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/expr.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/func.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/hash.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/insert.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/main.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/opcodes.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/os.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/pager.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/parse.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/pragma.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/printf.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/random.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/select.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/shell.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/table.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/tokenize.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/trigger.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/update.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/util.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/vacuum.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/vdbe.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/vdbeaux.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/where.c
+ )
+
+ ENDIF(SQLITE_FOUND)
SET(libhaar_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/libs/database/haar/haar.cpp
--- a/digikam/CMakeLists.txt
+++ b/digikam/CMakeLists.txt
@@ -240,6 +240,7 @@ TARGET_LINK_LIBRARIES(digikamdatabase
${QT_QTCORE_LIBRARY}
${QT_QTGUI_LIBRARY}
${QT_QTSQL_LIBRARY}
+ ${sqlite_LIBS}
)
SET_TARGET_PROPERTIES(digikamdatabase PROPERTIES VERSION 1.0.0 SOVERSION 1 )
--
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the Digikam-devel
mailing list