cmake: Added sqlite3-check

This commit is contained in:
tastytea 2018-10-22 19:15:55 +02:00
parent 97a5cbd1e6
commit bb2a68d326
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
2 changed files with 9 additions and 6 deletions

View File

@ -9,7 +9,7 @@ pipeline:
- rm /etc/apt/apt.conf.d/docker-clean
- apt-get update -q
- apt-get install -qy build-essential cmake pkg-config
- apt-get install -qy libvsqlitepp-dev libboost-dev libxdg-basedir-dev qt5-default qttools5-dev-tools
- apt-get install -qy libvsqlitepp-dev libboost-dev libxdg-basedir-dev qt5-default qttools5-dev-tools qttools5-dev
- apt-get install -qy rpm file wget appstream
- rm -rf build && mkdir -p build && cd build
- cmake -DCMAKE_INSTALL_PREFIX=/usr ..

View File

@ -7,6 +7,7 @@ project (whyblocked
include(GNUInstallDirs)
find_package(PkgConfig REQUIRED)
pkg_check_modules(LIBXDG_BASEDIR REQUIRED libxdg-basedir)
pkg_check_modules(SQLITE3 REQUIRED sqlite3)
find_package(Qt5Core CONFIG REQUIRED)
if(NOT WITHOUT_GUI)
find_package(Qt5Widgets CONFIG REQUIRED)
@ -23,8 +24,10 @@ set(CMAKE_AUTOUIC ON)
include_directories(${PROJECT_BINARY_DIR})
include_directories(${LIBXDG_BASEDIR_INCLUDE_DIRS})
include_directories(${SQLITE3_INCLUDE_DIRS})
link_directories(${LIBXDG_BASEDIR_LIBRARY_DIRS})
link_directories(${SQLITE3_LIBRARY_DIRS})
# Write version in header
configure_file (
@ -32,16 +35,16 @@ configure_file (
"${PROJECT_BINARY_DIR}/version.hpp"
)
set(COMMON_LIBRARIES
${LIBXDG_BASEDIR_LIBRARIES} ${SQLITE3_LIBRARIES} vsqlitepp stdc++fs)
add_executable(whyblocked src/interface_text.cpp src/whyblocked.cpp)
target_link_libraries(whyblocked
${LIBXDG_BASEDIR_LIBRARIES} vsqlitepp stdc++fs Qt5::Core)
target_link_libraries(whyblocked ${COMMON_LIBRARIES} Qt5::Core)
install(TARGETS whyblocked DESTINATION ${CMAKE_INSTALL_BINDIR})
if(NOT WITHOUT_GUI)
add_executable(whyblocked-gui src/interface_qt.cpp src/whyblocked.cpp)
target_link_libraries(whyblocked-gui
${LIBXDG_BASEDIR_LIBRARIES} vsqlitepp stdc++fs
Qt5::Widgets)
target_link_libraries(whyblocked-gui ${COMMON_LIBRARIES} Qt5::Widgets)
install(TARGETS whyblocked-gui DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES de.tastytea.Whyblocked.desktop DESTINATION