diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2019-11-07 13:44:35 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2019-11-07 13:48:09 +0100 |
| commit | d2a2b3e4e99b3f661fc6167db332b3b2d9e50591 (patch) | |
| tree | 6b78218b0b5012a9172f282b9687ba99b4cfcf85 /cmake/FindSqlite3.cmake | |
| parent | 34dc695402ba5d10248ea47bec3ab88ed950eccb (diff) | |
| download | PROJ-d2a2b3e4e99b3f661fc6167db332b3b2d9e50591.tar.gz PROJ-d2a2b3e4e99b3f661fc6167db332b3b2d9e50591.zip | |
Build: require SQLite 3.11 (refs #1718)
PROJ can build and run against older version (3.7 for example), but it has
been found that performance is horrible. With 3.11 (Ubuntu 16.04), it is
fine, so sets this as the minimum version.
Diffstat (limited to 'cmake/FindSqlite3.cmake')
| -rw-r--r-- | cmake/FindSqlite3.cmake | 13 |
1 files changed, 13 insertions, 0 deletions
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() |
