From 77b93a367cef9911adcccc379c659207fa9a43dd Mon Sep 17 00:00:00 2001 From: tastytea Date: Thu, 18 Oct 2018 00:27:51 +0200 Subject: [PATCH] Added possibility to compile without GUI --- CMakeLists.txt | 9 ++++++--- src/interface_text.cpp | 2 ++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a0fb125..310550e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,9 @@ project (whyblocked include(GNUInstallDirs) find_package(PkgConfig REQUIRED) pkg_check_modules(LIBXDG_BASEDIR REQUIRED libxdg-basedir) -find_package(Qt5Widgets CONFIG REQUIRED) +if(NOT WITHOUT_GUI) + find_package(Qt5Widgets CONFIG REQUIRED) +endif() find_package(Qt5LinguistTools) set(CMAKE_CXX_STANDARD 14) @@ -44,8 +46,9 @@ target_link_libraries(whyblocked ${LIBXDG_BASEDIR_LIBRARIES} vsqlitepp stdc++fs) install(TARGETS whyblocked DESTINATION ${CMAKE_INSTALL_BINDIR}) -if(NOT WITHOUT_QT) - add_executable(whyblocked-gui src/interface_qt.cpp src/whyblocked.cpp ${QM_FILES}) +if(NOT WITHOUT_GUI) + add_executable(whyblocked-gui src/interface_qt.cpp src/whyblocked.cpp + ${QM_FILES}) target_link_libraries(whyblocked-gui ${LIBXDG_BASEDIR_LIBRARIES} vsqlitepp stdc++fs Qt5::Widgets) diff --git a/src/interface_text.cpp b/src/interface_text.cpp index c738cf2..766c861 100644 --- a/src/interface_text.cpp +++ b/src/interface_text.cpp @@ -15,6 +15,8 @@ */ #include +#include +#include #include "version.hpp" #include "whyblocked.hpp"