initial cmake tweaks to allow system sqlite3 - on linux
This commit is contained in:
parent
3d560ba53b
commit
e0205f5358
2 changed files with 30 additions and 6 deletions
|
@ -20,6 +20,8 @@
|
||||||
#
|
#
|
||||||
# Variables:
|
# Variables:
|
||||||
# BUILD_WITH_QT6 - Build either with Qt 6 or Qt 5.
|
# BUILD_WITH_QT6 - Build either with Qt 6 or Qt 5.
|
||||||
|
# USE_SYSTEM_SQLITE - Use system-wide SQLite3 library and header file. Defaults to "OFF" in whic
|
||||||
|
# case bundled "sqlite3.h" and "sqlite3.c" are used.
|
||||||
# NO_UPDATE_CHECK - Disable automatic checking for new application updates.
|
# NO_UPDATE_CHECK - Disable automatic checking for new application updates.
|
||||||
# IS_FLATPAK_BUILD - Set to "ON" when building RSS Guard with Flatpak.
|
# IS_FLATPAK_BUILD - Set to "ON" when building RSS Guard with Flatpak.
|
||||||
# FORCE_BUNDLE_ICONS - Forcibly bundles icons into executables.
|
# FORCE_BUNDLE_ICONS - Forcibly bundles icons into executables.
|
||||||
|
@ -34,7 +36,7 @@
|
||||||
# - supports Windows, Linux, *BSD, macOS, OS/2, Android,
|
# - supports Windows, Linux, *BSD, macOS, OS/2, Android,
|
||||||
# - Qt 5.12.0 or newer is required,
|
# - Qt 5.12.0 or newer is required,
|
||||||
# - Qt 6.3.0 or newer is required,
|
# - Qt 6.3.0 or newer is required,
|
||||||
# - cmake 3.9.0 or newer is required,
|
# - cmake 3.14.0 or newer is required,
|
||||||
# - if you wish to make packages for Windows, then you must initialize all submodules
|
# - if you wish to make packages for Windows, then you must initialize all submodules
|
||||||
# within repository before compilation,
|
# within repository before compilation,
|
||||||
# - C++ 17 is required.
|
# - C++ 17 is required.
|
||||||
|
@ -54,7 +56,7 @@
|
||||||
#
|
#
|
||||||
#################################################################
|
#################################################################
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.9.0)
|
cmake_minimum_required(VERSION 3.14.0)
|
||||||
|
|
||||||
# Global variables describing the project.
|
# Global variables describing the project.
|
||||||
string(TIMESTAMP YEAR "%Y")
|
string(TIMESTAMP YEAR "%Y")
|
||||||
|
@ -108,6 +110,7 @@ endif()
|
||||||
|
|
||||||
# Global compilation switches.
|
# Global compilation switches.
|
||||||
option(BUILD_WITH_QT6 "Build application with Qt 6" OFF)
|
option(BUILD_WITH_QT6 "Build application with Qt 6" OFF)
|
||||||
|
option(USE_SYSTEM_SQLITE "Use system-wide SQLite3 library." OFF)
|
||||||
option(USE_WEBENGINE "Use QtWebEngine for embedded web browser" ON)
|
option(USE_WEBENGINE "Use QtWebEngine for embedded web browser" ON)
|
||||||
option(UPDATE_TRANSLATIONS "Call lupdate to update translation files from source (Qt 6 only)" OFF)
|
option(UPDATE_TRANSLATIONS "Call lupdate to update translation files from source (Qt 6 only)" OFF)
|
||||||
option(FORCE_COLORED_OUTPUT "Always produce ANSI-colored output (GCC/Clang only)" OFF)
|
option(FORCE_COLORED_OUTPUT "Always produce ANSI-colored output (GCC/Clang only)" OFF)
|
||||||
|
|
|
@ -519,10 +519,20 @@ list(APPEND SOURCES
|
||||||
)
|
)
|
||||||
|
|
||||||
# Add sqlite.
|
# Add sqlite.
|
||||||
list(APPEND SOURCES
|
if(USE_SYSTEM_SQLITE)
|
||||||
|
find_package(SQLite3)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(SQLite3_FOUND)
|
||||||
|
# Include directory and library are linked to below.
|
||||||
|
else()
|
||||||
|
message(STATUS "Using bundled SQLite3.")
|
||||||
|
|
||||||
|
list(APPEND SOURCES
|
||||||
3rd-party/sqlite/sqlite3.c
|
3rd-party/sqlite/sqlite3.c
|
||||||
3rd-party/sqlite/sqlite3.h
|
3rd-party/sqlite/sqlite3.h
|
||||||
)
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Add SimpleCrypt.
|
# Add SimpleCrypt.
|
||||||
list(APPEND SOURCES
|
list(APPEND SOURCES
|
||||||
|
@ -644,6 +654,17 @@ target_include_directories(rssguard
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/gui/richtexteditor
|
${CMAKE_CURRENT_SOURCE_DIR}/gui/richtexteditor
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(SQLite3_FOUND)
|
||||||
|
target_include_directories(rssguard AFTER
|
||||||
|
PRIVATE
|
||||||
|
${SQLite3_INCLUDE_DIRS}
|
||||||
|
)
|
||||||
|
|
||||||
|
target_link_libraries(rssguard PRIVATE
|
||||||
|
${SQLite3_LIBRARIES}
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Qt.
|
# Qt.
|
||||||
target_link_libraries(rssguard PUBLIC
|
target_link_libraries(rssguard PUBLIC
|
||||||
Qt${QT_VERSION_MAJOR}::Core
|
Qt${QT_VERSION_MAJOR}::Core
|
||||||
|
|
Loading…
Add table
Reference in a new issue