Skip to content

Commit

Permalink
sqlite3: require sqlite >= 3.9.0
Browse files Browse the repository at this point in the history
The generated schema is malformed in versions below 3.9.0.
  • Loading branch information
abathur committed Oct 17, 2018
1 parent eec2d3b commit e4f408e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
5 changes: 4 additions & 1 deletion CMakeLists.txt
Expand Up @@ -86,7 +86,10 @@ find_package(BISON REQUIRED)
find_package(Threads)

if (sqlite3)
find_package(SQLite3 REQUIRED)
find_package(SQLite3 REQUIRED)
if (SQLITE3_VERSION VERSION_LESS 3.9.0)
message(SEND_ERROR "Doxygen requires at least sqlite3 version 3.9.0 (installed: ${SQLITE3_VERSION})")
endif()
endif()

find_package(Iconv REQUIRED)
Expand Down
10 changes: 9 additions & 1 deletion cmake/FindSQLite3.cmake
Expand Up @@ -71,8 +71,16 @@ else (SQLITE3_LIBRARIES AND SQLITE3_INCLUDE_DIRS)
endif (SQLITE3_INCLUDE_DIRS AND SQLITE3_LIBRARIES)

if (SQLITE3_FOUND)

# Extract version from header file
find_file(SQLITE3_HEADER "sqlite3.h" HINTS ${SQLITE3_INCLUDE_DIRS})
if(SQLITE3_HEADER)
file(STRINGS "${SQLITE3_HEADER}" _DEF_TMP REGEX "^#define SQLITE_VERSION +\\\"[^\\\"]+\\\"")
string (REGEX REPLACE ".*\\\"(([0-9]+[.]?)+).*" "\\1" SQLITE3_VERSION "${_DEF_TMP}")
endif (SQLITE3_HEADER)

if (NOT Sqlite3_FIND_QUIETLY)
message(STATUS "Found Sqlite3: ${SQLITE3_LIBRARIES}")
message(STATUS "Found Sqlite3: ${SQLITE3_LIBRARIES} (found version \"${SQLITE3_VERSION}\")")
endif (NOT Sqlite3_FIND_QUIETLY)
else (SQLITE3_FOUND)
if (Sqlite3_FIND_REQUIRED)
Expand Down

0 comments on commit e4f408e

Please sign in to comment.