Skip to content

Commit 6cf3ce4

Browse files
CMake: Disable both the FTS extensions and the R*Tree module by default
1 parent 2ca1381 commit 6cf3ce4

File tree

1 file changed

+30
-6
lines changed

1 file changed

+30
-6
lines changed

CMakeLists.txt

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
cmake_minimum_required(VERSION 3.13.3)
88
project(thirdparty_sqlite)
99

10-
option(SQLITE_GENERATE_INSTALL_TARGET "When enabled, will cause the project to create the install targets" OFF)
10+
option(SQLITE_ENABLE_INSTALL_TARGET "When enabled, will cause the project to create the install targets" OFF)
11+
option(SQLITE_ENABLE_FULL_TEXT_SEARCH_EXTENSIONS "Set to ON to enable the FTS extensions" OFF)
12+
option(SQLITE_ENABLE_RTREE_EXTENSION "Set to ON to enable the R*Tree module" OFF)
1113

1214
function(sqliteMain)
1315
set(parameter_list
@@ -17,10 +19,6 @@ function(sqliteMain)
1719

1820
set(option_list
1921
SQLITE_ENABLE_COLUMN_METADATA
20-
SQLITE_ENABLE_RTREE
21-
SQLITE_ENABLE_FTS3
22-
SQLITE_ENABLE_FTS3_PARENTHESIS
23-
SQLITE_ENABLE_FTS5
2422
SQLITE_SECURE_DELETE
2523
SQLITE_ENABLE_UNLOCK_NOTIFY
2624
SQLITE_ENABLE_DBSTAT_VTAB
@@ -30,6 +28,30 @@ function(sqliteMain)
3028
SQLITE_SOUNDEX
3129
)
3230

31+
if(${SQLITE_ENABLE_RTREE_EXTENSION})
32+
message(STATUS "Enabling the SQLite R*Tree module")
33+
34+
list(APPEND option_list
35+
SQLITE_ENABLE_RTREE
36+
)
37+
38+
else()
39+
message(STATUS "Disabling the SQLite R*Tree module")
40+
endif()
41+
42+
if(${SQLITE_ENABLE_FULL_TEXT_SEARCH_EXTENSIONS})
43+
message(STATUS "Enabling the SQLite FTS extensions")
44+
45+
list(APPEND option_list
46+
SQLITE_ENABLE_FTS3
47+
SQLITE_ENABLE_FTS3_PARENTHESIS
48+
SQLITE_ENABLE_FTS5
49+
)
50+
51+
else()
52+
message(STATUS "Disabling the SQLite FTS extensions")
53+
endif()
54+
3355
add_library(thirdparty_sqlite
3456
src/sqlite3.c
3557
)
@@ -48,7 +70,9 @@ function(sqliteMain)
4870
"${CMAKE_CURRENT_SOURCE_DIR}/src"
4971
)
5072

51-
if(SQLITE_GENERATE_INSTALL_TARGET)
73+
if(SQLITE_ENABLE_INSTALL_TARGET)
74+
message(STATUS "Enabling the install target")
75+
5276
install(TARGETS thirdparty_sqlite DESTINATION lib)
5377
install(FILES src/sqlite3ext.h src/sqlite3.h DESTINATION include)
5478
endif()

0 commit comments

Comments
 (0)