Skip to content

Commit 11fab0f

Browse files
authored
Merge pull request #229 from xvitaly/systemsqlite
Explicitly find and link against system sqlite library
2 parents 8329e7a + 395c047 commit 11fab0f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

CMakeLists.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -206,12 +206,6 @@ install(EXPORT ${PROJECT_NAME}Config DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/$
206206

207207
## Build provided copy of SQLite3 C library ##
208208

209-
# TODO
210-
#find_package(sqlite3)
211-
#if(sqlite3_VERSION VERSION_LESS "3.19")
212-
# set_target_properties(SQLiteCpp PROPERTIES COMPILE_FLAGS "-DSQLITECPP_HAS_MEM_STRUCT")
213-
#endif()
214-
215209
option(SQLITECPP_USE_ASAN "Use Address Sanitizer." OFF)
216210
if (SQLITECPP_USE_ASAN)
217211
if ((CMAKE_CXX_COMPILER_VERSION GREATER_EQUAL 6) OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang"))
@@ -230,6 +224,12 @@ if (SQLITECPP_INTERNAL_SQLITE)
230224
add_subdirectory(sqlite3)
231225
target_include_directories(sqlite3 PUBLIC "${PROJECT_SOURCE_DIR}/sqlite3")
232226
target_include_directories(SQLiteCpp PRIVATE "${PROJECT_SOURCE_DIR}/sqlite3")
227+
else (SQLITECPP_INTERNAL_SQLITE)
228+
find_package (SQLite3 REQUIRED)
229+
if (SQLITE3_FOUND)
230+
include_directories(${SQLITE3_INCLUDE_DIRS})
231+
target_link_libraries (SQLiteCpp ${SQLITE3_LIBRARIES})
232+
endif (SQLITE3_FOUND)
233233
endif (SQLITECPP_INTERNAL_SQLITE)
234234

235235
# Optional additional targets:

0 commit comments

Comments
 (0)