aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt6
-rw-r--r--cmake/FindSqlite3.cmake13
-rw-r--r--configure.ac6
3 files changed, 24 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 63f516a3..2761e542 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -127,6 +127,12 @@ if(NOT SQLITE3_FOUND)
message(SEND_ERROR "sqlite3 dependency not found!")
endif()
+# Would build and run with older versons, but with horrible performance
+# See https://github.com/OSGeo/PROJ/issues/1718
+IF("${SQLITE3_VERSION}" VERSION_LESS "3.11")
+ message(SEND_ERROR "sqlite3 >= 3.11 required!")
+ENDIF()
+
################################################################################
# threading configuration
################################################################################
diff --git a/cmake/FindSqlite3.cmake b/cmake/FindSqlite3.cmake
index 4f1d909f..06cba0fb 100644
--- a/cmake/FindSqlite3.cmake
+++ b/cmake/FindSqlite3.cmake
@@ -10,6 +10,7 @@
# and following variables are set:
# SQLITE3_INCLUDE_DIR
# SQLITE3_LIBRARY
+# SQLITE3_VERSION
# find_path and find_library normally search standard locations
@@ -53,9 +54,21 @@ if(SQLITE3_INCLUDE_DIR AND SQLITE3_LIBRARY)
set(SQLITE3_FOUND TRUE)
endif()
+# Extract version information from the header file
+if(SQLITE3_INCLUDE_DIR)
+ file(STRINGS ${SQLITE3_INCLUDE_DIR}/sqlite3.h _ver_line
+ REGEX "^#define SQLITE_VERSION *\"[0-9]+\\.[0-9]+\\.[0-9]+\""
+ LIMIT_COUNT 1)
+ string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+"
+ SQLITE3_VERSION "${_ver_line}")
+ unset(_ver_line)
+endif()
+
+
if(SQLITE3_FOUND)
if(NOT SQLITE3_FIND_QUIETLY)
message(STATUS "Found Sqlite3: ${SQLITE3_LIBRARY}")
+ message(STATUS "Sqlite3 version: ${SQLITE3_VERSION}")
endif()
else()
diff --git a/configure.ac b/configure.ac
index 7a6814b4..e9274621 100644
--- a/configure.ac
+++ b/configure.ac
@@ -280,7 +280,11 @@ dnl Check for sqlite3 library and binary
dnl ---------------------------------------------------------------------------
if test "x$SQLITE3_CFLAGS$SQLITE3_LIBS" = "x" ; then
- PKG_CHECK_MODULES([SQLITE3], [sqlite3 >= 3.7])
+
+ dnl Would build and run with older versons, but with horrible performance
+ dnl See https://github.com/OSGeo/PROJ/issues/1718
+
+ PKG_CHECK_MODULES([SQLITE3], [sqlite3 >= 3.11])
fi
AC_SUBST(SQLITE3_CFLAGS,$SQLITE3_CFLAGS)
AC_SUBST(SQLITE3_LIBS,$SQLITE3_LIBS)