Skip to content

Commit

Permalink
Add link to SQLiteCpp
Browse files Browse the repository at this point in the history
  • Loading branch information
kraxarn committed Oct 22, 2021
1 parent 039e6c3 commit 0d16afd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 22 deletions.
25 changes: 3 additions & 22 deletions lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,28 +35,9 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
target_compile_options(spotify-qt-lib PRIVATE -Wall -Wextra)
endif ()

# SQLite cache support
if (NOT DEFINED USE_DB_CACHE)
set(USE_DB_CACHE ON)
endif ()

# TODO: On error, use bundled SQLite instead
if (USE_DB_CACHE)
find_package(PkgConfig QUIET)
if (PkgConfig_FOUND)
pkg_check_modules(SQLITE sqlite3 QUIET)
if (SQLITE_FOUND)
target_link_directories(spotify-qt-lib PRIVATE "${SQLITE_LIBRARY_DIRS}")
target_include_directories(spotify-qt-lib PRIVATE "${SQLITE_INCLUDE_DIRS}")
target_link_libraries(spotify-qt-lib PRIVATE "${SQLITE_LIBRARIES}")
message(STATUS "Using SQLite ${SQLITE_VERSION} (system)")
else ()
message(WARNING "SQLite error: sqlite3 not found")
endif ()
else ()
message(WARNING "SQLite error: pkg-config not found")
endif ()
endif ()
# External projects
add_subdirectory(thirdparty)
target_link_libraries(spotify-qt-lib PRIVATE spotify-qt-lib-third-party)

# Link optional libraries
if (LIB_QT_LIBRARIES)
Expand Down
10 changes: 10 additions & 0 deletions lib/thirdparty/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
project(spotify-qt-lib-third-party)

# SQLiteCpp
add_subdirectory(SQLiteCpp)

# Link
add_library(spotify-qt-lib-third-party STATIC)
target_link_libraries(spotify-qt-lib-third-party
SQLiteCpp
sqlite3)

0 comments on commit 0d16afd

Please sign in to comment.