Skip to content
Snippets Groups Projects
Commit bc703a5e authored by Studer Gabriel's avatar Studer Gabriel
Browse files

use system-provided SQLite3 library

The reason is that we want to profit from latest security updates and
therefore not use a copy of the SQLite3 source code that becomes outdated.

ToDo: test on different Linux distributions / bc2 and adapt compile
instructions accordingly, also container recipes must be adapted.
parent b18b0026
Branches
Tags
No related merge requests found
Changes in Release 1.x.x
--------------------------------------------------------------------------------
* Use system provided SQLite3 library
Changes in Release 1.9.0 Changes in Release 1.9.0
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
......
...@@ -234,6 +234,7 @@ endif() ...@@ -234,6 +234,7 @@ endif()
find_package(Eigen 3.2.0 REQUIRED) find_package(Eigen 3.2.0 REQUIRED)
find_package(Python 2.4 REQUIRED) find_package(Python 2.4 REQUIRED)
find_package(SQLite3 REQUIRED)
if(USE_NUMPY) if(USE_NUMPY)
find_package(Numpy REQUIRED) find_package(Numpy REQUIRED)
......
# Try to find SQLite3
#
# Once done this will define
# - Find SQLite3
# Find the native SQLite3 includes and library
#
# SQLITE3_INCLUDE_DIRS - SQLite3 include dirs.
# SQLITE3_LIBRARIES - List of libraries when using SQLite3.
# SQLITE3_FOUND - True if SQLite3 found.
find_path(SQLITE3_INCLUDE_DIR NAMES sqlite3.h)
find_library(SQLITE3_LIBRARY NAMES sqlite3)
# handle the QUIETLY and REQUIRED arguments and set SQLITE3_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(SQLITE3 DEFAULT_MSG SQLITE3_LIBRARY SQLITE3_INCLUDE_DIR)
IF(SQLITE3_FOUND)
SET(SQLITE3_INCLUDE_DIRS ${SQLITE3_INCLUDE_DIR})
SET(SQLITE3_LIBRARIES ${SQLITE3_LIBRARY})
ELSE(SQLITE3_FOUND)
SET(SQLITE3_INCLUDE_DIRS)
SET(SQLITE3_LIBRARIES)
ENDIF(SQLITE3_FOUND)
mark_as_advanced(SQLITE3_LIBRARY SQLITE3_INCLUDE_DIR)
...@@ -22,8 +22,7 @@ ...@@ -22,8 +22,7 @@
#include <map> #include <map>
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
// our own local copy of sqlite3 #include <sqlite3.h>
#include <ost/db/sqlite3.h>
#include "module_config.hh" #include "module_config.hh"
#include "compound.hh" #include "compound.hh"
......
set(OST_DB_HEADERS set(OST_DB_HEADERS
sqlite_wrap.hh sqlite_wrap.hh
sqlite3.h
sqlite_conv.hh sqlite_conv.hh
module_config.hh module_config.hh
) )
set(OST_DB_SOURCES set(OST_DB_SOURCES
sqlite_wrap.cc sqlite_wrap.cc
sqlite3.c
) )
module(NAME db SOURCES ${OST_DB_SOURCES} HEADERS ${OST_DB_HEADERS} module(NAME db SOURCES ${OST_DB_SOURCES} HEADERS ${OST_DB_HEADERS}
DEPENDS_ON ost_base) DEPENDS_ON ost_base sqlite3)
if(WIN32) if(WIN32)
set_target_properties(ost_db PROPERTIES LINK_FLAGS "/DEF:${CMAKE_CURRENT_SOURCE_DIR}/sqlite3.def") set_target_properties(ost_db PROPERTIES LINK_FLAGS "/DEF:${CMAKE_CURRENT_SOURCE_DIR}/sqlite3.def")
add_definitions(/DSQLITE_ENABLE_COLUMN_METADATA) add_definitions(/DSQLITE_ENABLE_COLUMN_METADATA)
......
Source diff could not be displayed: it is too large. Options to address this: view the blob.
Source diff could not be displayed: it is too large. Options to address this: view the blob.
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#ifndef OST_IO_SQLITE_CONV_HH #ifndef OST_IO_SQLITE_CONV_HH
#define OST_IO_SQLITE_CONV_HH #define OST_IO_SQLITE_CONV_HH
#include "sqlite3.h" #include <sqlite3.h>
#include <ost/db/module_config.hh> #include <ost/db/module_config.hh>
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
#include <ost/base.hh> #include <ost/base.hh>
#include <ost/message.hh> #include <ost/message.hh>
#include "sqlite3.h" #include <sqlite3.h>
#include "sqlite_conv.hh" #include "sqlite_conv.hh"
namespace ost { namespace db { namespace ost { namespace db {
......
...@@ -33,6 +33,7 @@ required version is given in parentheses. ...@@ -33,6 +33,7 @@ required version is given in parentheses.
* `Boost <http://boost.org>`_ (1.53) * `Boost <http://boost.org>`_ (1.53)
* `zlib <https://zlib.net/>`_ (usually comes with Boost or system) * `zlib <https://zlib.net/>`_ (usually comes with Boost or system)
* `Eigen3 <http://eigen.tuxfamily.org>`_ (3.2.0) * `Eigen3 <http://eigen.tuxfamily.org>`_ (3.2.0)
* `SQLite3 <https://www3.sqlite.org>`_ (3.7.13)`
When you enable support for image processing, you will need: When you enable support for image processing, you will need:
...@@ -215,6 +216,10 @@ can influence it. ...@@ -215,6 +216,10 @@ can influence it.
starting with `libtiff`) starting with `libtiff`)
* `TIFF_INCLUDE_DIR` defines the include folder of libtiff (contains include * `TIFF_INCLUDE_DIR` defines the include folder of libtiff (contains include
files directly) files directly)
* `SQLITE3_LIBRARY` defines the location of the SQLite3 library (file name starting
with `libsqlite3`)
* `SQLITE3_INCLUDE_DIR` defines the include folder of SQLite3 (contains include
files directly)
* Usually, you will receive errors for those variables when executing `cmake` * Usually, you will receive errors for those variables when executing `cmake`
and set them accordingly as needed. and set them accordingly as needed.
...@@ -300,7 +305,7 @@ All the dependencies can be installed from the package manager as follows: ...@@ -300,7 +305,7 @@ All the dependencies can be installed from the package manager as follows:
sudo apt-get install cmake sip-dev libtiff-dev libfftw3-dev libeigen3-dev \ sudo apt-get install cmake sip-dev libtiff-dev libfftw3-dev libeigen3-dev \
libpng-dev python-all python2.7 python-qt4 libboost-all-dev \ libpng-dev python-all python2.7 python-qt4 libboost-all-dev \
qt4-qtconfig qt4-qmake libqt4-dev libpng-dev qt4-qtconfig qt4-qmake libqt4-dev libpng-dev libsqlite3-dev
Now, all dependencies are located in standard locations and cmake will Now, all dependencies are located in standard locations and cmake will
automatically find them without the need to pass any additional parameters. The automatically find them without the need to pass any additional parameters. The
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment