diff options
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | lib/web/profilemanager.h | 1 | ||||
-rw-r--r-- | plugins/ConfigurationEditor/CMakeLists.txt | 6 | ||||
-rw-r--r-- | plugins/ProfileEditor/CMakeLists.txt | 9 | ||||
-rw-r--r-- | src/CMakeLists.txt | 31 | ||||
-rw-r--r-- | src/browser.cpp | 6 | ||||
-rw-r--r-- | src/mainwindow/mainwindow.cpp | 4 | ||||
-rw-r--r-- | src/session.cpp | 2 | ||||
-rw-r--r-- | src/subwindow/subwindow.cpp | 6 | ||||
-rw-r--r-- | src/subwindow/tabwidget.cpp | 2 | ||||
-rw-r--r-- | src/webengine/webview.cpp | 4 | ||||
-rw-r--r-- | vendor.cmake | 27 |
12 files changed, 56 insertions, 44 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 20b4f01..a966253 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -63,7 +63,7 @@ endif() # Summarize message(STATUS "=== Configuration summary ===") -message(STATUS "Building ${poi_NAME} ${VerTag}; version ${VerDescribe} ${VerBranch}:${VerCommit}") +message(STATUS "Building ${poi_exe} ${VerTag}; version ${VerDescribe} ${VerBranch}:${VerCommit}") message(STATUS "vendor.cmake: ${VENDOR}") message(STATUS "Platform: ${CMAKE_SYSTEM_NAME}") diff --git a/lib/web/profilemanager.h b/lib/web/profilemanager.h index 72af472..500f090 100644 --- a/lib/web/profilemanager.h +++ b/lib/web/profilemanager.h @@ -11,7 +11,6 @@ #include <QObject> #include <QMap> -#include <webprofile.h> #include <QSettings> #include <map> #include <memory> diff --git a/plugins/ConfigurationEditor/CMakeLists.txt b/plugins/ConfigurationEditor/CMakeLists.txt index 0df613f..22ef3d3 100644 --- a/plugins/ConfigurationEditor/CMakeLists.txt +++ b/plugins/ConfigurationEditor/CMakeLists.txt @@ -13,7 +13,7 @@ add_library(ConfigurationEditorPlugin SHARED ) target_include_directories(ConfigurationEditorPlugin - PRIVATE .. + PRIVATE ${CMAKE_SOURCE_DIR}/plugins PRIVATE ${CMAKE_SOURCE_DIR}/lib/configuration PRIVATE ${Boost_INCLUDE_DIRS} ) @@ -24,7 +24,7 @@ target_link_libraries(ConfigurationEditorPlugin ) if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") - install(TARGETS ConfigurationEditorPlugin RUNTIME DESTINATION ${PLUGIN_DESTINATION} CONFIGURATIONS Release) + install(TARGETS ConfigurationEditorPlugin RUNTIME DESTINATION ${installPath_plugin} CONFIGURATIONS Release) else() - install(TARGETS ConfigurationEditorPlugin LIBRARY DESTINATION ${PLUGIN_DESTINATION} CONFIGURATIONS Release) + install(TARGETS ConfigurationEditorPlugin LIBRARY DESTINATION ${installPath_plugin} CONFIGURATIONS Release) endif() diff --git a/plugins/ProfileEditor/CMakeLists.txt b/plugins/ProfileEditor/CMakeLists.txt index 6237785..d22d3d6 100644 --- a/plugins/ProfileEditor/CMakeLists.txt +++ b/plugins/ProfileEditor/CMakeLists.txt @@ -23,8 +23,9 @@ add_library(ProfileEditorPlugin SHARED ) target_include_directories(ProfileEditorPlugin - PRIVATE .. - PRIVATE ../../lib/web) + PRIVATE ${CMAKE_SOURCE_DIR}/plugins + PRIVATE ${CMAKE_SOURCE_DIR}/lib/web +) target_link_libraries(ProfileEditorPlugin PRIVATE Qt5::Widgets @@ -33,7 +34,7 @@ target_link_libraries(ProfileEditorPlugin ) if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") - install(TARGETS ProfileEditorPlugin RUNTIME DESTINATION ${PLUGIN_DESTINATION} CONFIGURATIONS Release) + install(TARGETS ProfileEditorPlugin RUNTIME DESTINATION ${installPath_plugin} CONFIGURATIONS Release) else() - install(TARGETS ProfileEditorPlugin LIBRARY DESTINATION ${PLUGIN_DESTINATION} CONFIGURATIONS Release) + install(TARGETS ProfileEditorPlugin LIBRARY DESTINATION ${installPath_plugin} CONFIGURATIONS Release) endif() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5db6e36..df2aeeb 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -6,14 +6,16 @@ set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOUIC ON) set(CMAKE_AUTORCC ON) -set(poi_SRC +set(srclist # main main.cpp browser.cpp browser.h session.cpp session.h - ../data/resources.qrc + + # resources (icons, etc) + ${PROJECT_SOURCE_DIR}/data/resources.qrc # main window mainwindow/mainwindow.cpp @@ -46,19 +48,19 @@ set(poi_SRC ) if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") - add_executable(${poi_NAME} WIN32 ${poi_SRC} ../data/windows.rc) + add_executable(${poi_exe} WIN32 ${srclist} ${PROJECT_SOURCE_DIR}/data/windows.rc) else() - add_executable(${poi_NAME} ${poi_SRC}) + add_executable(${poi_exe} ${srclist}) endif() -target_include_directories(${poi_NAME} +target_include_directories(${poi_exe} PRIVATE ${Boost_INCLUDE_DIRS} - PRIVATE ../3rd-party - PRIVATE ../lib ../plugins - PRIVATE ../lib/configuration - PRIVATE ../lib/web) + PRIVATE ${PROJECT_SOURCE_DIR}/3rd-party + PRIVATE ${PROJECT_SOURCE_DIR}/lib + PRIVATE ${PROJECT_SOURCE_DIR}/plugins +) -target_link_libraries(${poi_NAME} +target_link_libraries(${poi_exe} Qt5::Core Qt5::Widgets Qt5::Concurrent Qt5::WebEngineWidgets ${Boost_LIBRARIES} SingleApplication @@ -69,16 +71,17 @@ target_link_libraries(${poi_NAME} ) if(Plasma) - target_link_libraries(${poi_NAME} KF5::WindowSystem) - target_compile_definitions(${poi_NAME} + target_link_libraries(${poi_exe} KF5::WindowSystem) + target_compile_definitions(${poi_exe} PRIVATE PLASMA_BLUR # give the main window a translucent background and blur ) endif(Plasma) -target_compile_definitions(${poi_NAME} +target_compile_definitions(${poi_exe} PRIVATE QAPPLICATION_CLASS=QApplication + PRIVATE POI_NAME=\"${poi_name}\" PRIVATE QTBUG_65223_WORKAROUND #PRIVATE QTBUG_68224_WORKAROUND ) -install(TARGETS ${poi_NAME} RUNTIME DESTINATION ${BINARY_DESTINATION} CONFIGURATIONS Release) +install(TARGETS ${poi_exe} RUNTIME DESTINATION ${installPath_bin} CONFIGURATIONS Release) diff --git a/src/browser.cpp b/src/browser.cpp index 493493f..b5c98b0 100644 --- a/src/browser.cpp +++ b/src/browser.cpp @@ -22,14 +22,14 @@ #include <configuration/configuration.h> #include <downloads/downloadswidget.h> #include <version.h> -#include <webprofile.h> -#include "profilemanager.h" +#include <web/webprofile.h> +#include <web/profilemanager.h> #include <QJsonDocument> Browser::Browser(int &argc, char *argv[], bool allowSecondary) : SingleApplication(argc, argv, allowSecondary, SingleApplication::User | SingleApplication::SecondaryNotification | SingleApplication::ExcludeAppVersion) { - setApplicationName("smolbote"); + setApplicationName(POI_NAME); setWindowIcon(QIcon(":/icon.svg")); setApplicationVersion(SMOLBOTE_VERSION); } diff --git a/src/mainwindow/mainwindow.cpp b/src/mainwindow/mainwindow.cpp index eb4d34f..36fd8a6 100644 --- a/src/mainwindow/mainwindow.cpp +++ b/src/mainwindow/mainwindow.cpp @@ -29,13 +29,13 @@ #include <QToolBar> #include <QUrl> #include <configuration/configuration.h> -#include <webprofile.h> +#include <web/webprofile.h> #include "session.h" #include <QFileDialog> #include <QPrinter> #include <QPrinterInfo> #include <QPrintDialog> -#include "profilemanager.h" +#include <web/profilemanager.h> #include <QVBoxLayout> #ifdef PLASMA_BLUR #include <KWindowEffects> diff --git a/src/session.cpp b/src/session.cpp index 414e8aa..e1f600a 100644 --- a/src/session.cpp +++ b/src/session.cpp @@ -12,7 +12,7 @@ #include <QJsonObject> #include <QJsonArray> #include "webengine/webview.h" -#include "profilemanager.h" +#include <web/profilemanager.h> Session::Session(QObject *parent) : QObject(parent) { diff --git a/src/subwindow/subwindow.cpp b/src/subwindow/subwindow.cpp index 0873010..e4affec 100644 --- a/src/subwindow/subwindow.cpp +++ b/src/subwindow/subwindow.cpp @@ -18,9 +18,9 @@ #include <QShortcut> #include <QStyle> #include <QToolButton> -#include <webprofile.h> -#include "profilemanager.h" -#include <configuration.h> +#include <web/webprofile.h> +#include <web/profilemanager.h> +#include <configuration/configuration.h> #include <QTabBar> SubWindow::SubWindow(const std::unique_ptr<Configuration> &config, QWidget *parent, Qt::WindowFlags flags) diff --git a/src/subwindow/tabwidget.cpp b/src/subwindow/tabwidget.cpp index 1ddfc95..5583bcd 100644 --- a/src/subwindow/tabwidget.cpp +++ b/src/subwindow/tabwidget.cpp @@ -13,7 +13,7 @@ #include <QContextMenuEvent> #include <QMenu> #include <QTabBar> -#include <webprofile.h> +#include <web/webprofile.h> TabWidget::TabWidget(QWidget *parent) : QTabWidget(parent) diff --git a/src/webengine/webview.cpp b/src/webengine/webview.cpp index 963a894..ee08c34 100644 --- a/src/webengine/webview.cpp +++ b/src/webengine/webview.cpp @@ -7,10 +7,10 @@ */ #include "webview.h" -#include "profilemanager.h" +#include <web/profilemanager.h> #include "subwindow/subwindow.h" #include "webpage.h" -#include "webprofile.h" +#include <web/webprofile.h> #include <QContextMenuEvent> #include <QDialog> #include <QMenu> diff --git a/vendor.cmake b/vendor.cmake index 0e59149..45a9f7e 100644 --- a/vendor.cmake +++ b/vendor.cmake @@ -1,16 +1,25 @@ -# Build configuration - -# install paths -set(BINARY_DESTINATION bin) +## Build configuration +# Feel free to copy this file and change settings as you need. To use your own +# variant, use -DVENDOR=<path to your vendor.cmake> when generating the build +# script. + +## Naming +# Executable name +set(poi_exe poi) +# Application name +set(poi_name "smolbote") + +## Install Paths +# Binaries will be installed to ${CMAKE_INSTALL_PREFIX}/${installPath_bin} +set(installPath_bin bin) + +# Plugins will be installed to ${CMAKE_INSTALL_PREFIX}/${installPath_plugin} if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") - set(PLUGIN_DESTINATION bin/plugins) + set(installPath_plugin bin/plugins) else() - set(PLUGIN_DESTINATION lib/smolbote) + set(installPath_plugin lib/smolbote) endif() -# executable name -set(poi_NAME poi) - # version information if (EXISTS "${PROJECT_SOURCE_DIR}/.git") execute_process(COMMAND git rev-list --count HEAD WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} OUTPUT_VARIABLE VerRevision OUTPUT_STRIP_TRAILING_WHITESPACE) |