From d17bdc5223d10fa100602f2e16bce8083a2bcece Mon Sep 17 00:00:00 2001 From: jan Anja Date: Mon, 31 Jan 2022 13:11:48 +0500 Subject: [PATCH] port build system to cmake (#615) --- .github/workflows/rssguard.yml | 18 +- CMakeLists.txt | 171 ++++++ build.pro | 62 -- localization/CMakeLists.txt | 58 ++ pri/build_opts.pri | 96 --- pri/defs.pri | 36 -- pri/install.pri | 119 ---- pri/vars.pri | 75 --- resources/macosx/Info.plist.in | 8 +- resources/nsis/NSIS.definitions.nsh.in | 14 +- resources/rssguard.rc.in | 32 + .../scripts/github-actions/build-linux-mac.sh | 32 +- .../scripts/github-actions/build-windows.ps1 | 14 +- src/librssguard/CMakeLists.txt | 548 +++++++++++++++++ src/librssguard/librssguard.pro | 554 ------------------ .../reddit/gui/formeditredditaccount.h | 6 +- src/rssguard/CMakeLists.txt | 91 +++ src/rssguard/rssguard.pro | 64 -- 18 files changed, 946 insertions(+), 1052 deletions(-) create mode 100644 CMakeLists.txt delete mode 100644 build.pro create mode 100644 localization/CMakeLists.txt delete mode 100644 pri/build_opts.pri delete mode 100644 pri/defs.pri delete mode 100644 pri/install.pri delete mode 100644 pri/vars.pri create mode 100644 resources/rssguard.rc.in create mode 100644 src/librssguard/CMakeLists.txt delete mode 100644 src/librssguard/librssguard.pro create mode 100644 src/rssguard/CMakeLists.txt delete mode 100644 src/rssguard/rssguard.pro diff --git a/.github/workflows/rssguard.yml b/.github/workflows/rssguard.yml index 762da670f..1b9b1c0f5 100644 --- a/.github/workflows/rssguard.yml +++ b/.github/workflows/rssguard.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: os: [windows-2019, ubuntu-18.04, macos-10.15] - use_webengine: ["true", "false"] + use_webengine: ["ON", "OFF"] include: - os: windows-2019 script_name: .\resources\scripts\github-actions\build-windows.ps1 @@ -67,10 +67,10 @@ jobs: name: "Development builds" tag_name: "devbuild" files: | - .\rssguard-build\src\rssguard\rssguard-*win64.exe - .\rssguard-build\src\rssguard\rssguard-*win64.7z - ./rssguard-build/src/rssguard/rssguard-*mac64.dmg - ./rssguard-build/src/rssguard/rssguard-*linux64.AppImage + .\rssguard-build\rssguard-*win64.exe + .\rssguard-build\rssguard-*win64.7z + ./rssguard-build/rssguard-*mac64.dmg + ./rssguard-build/rssguard-*linux64.AppImage env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -80,9 +80,9 @@ jobs: with: prerelease: false files: | - .\rssguard-build\src\rssguard\rssguard-*win64.exe - .\rssguard-build\src\rssguard\rssguard-*win64.7z - ./rssguard-build/src/rssguard/rssguard-*mac64.dmg - ./rssguard-build/src/rssguard/rssguard-*linux64.AppImage + .\rssguard-build\rssguard-*win64.exe + .\rssguard-build\rssguard-*win64.7z + ./rssguard-build/rssguard-*mac64.dmg + ./rssguard-build/rssguard-*linux64.AppImage env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 000000000..46e9a1dd2 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,171 @@ +cmake_minimum_required(VERSION 3.9.0) + +project(rssguard VERSION 4.1.2 LANGUAGES CXX) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +option(USE_WEBENGINE "Use QtWebEngine for embedded web browser" ON) +option(UPDATE_TRANSLATIONS "Call lupdate to update translation files from source" OFF) +option(FORCE_COLORED_OUTPUT "Always produce ANSI-colored output (GCC/Clang only)" OFF) +option(REVISION_FROM_GIT "Get revision using `git rev-parse`" OFF) + +set(FEEDLY_CLIENT_ID "" CACHE STRING "Feedly client ID") +set(FEEDLY_CLIENT_SECRET "" CACHE STRING "Feedly client secret") + +set(GMAIL_CLIENT_ID "" CACHE STRING "GMail client ID") +set(GMAIL_CLIENT_SECRET "" CACHE STRING "GMail client secret") + +set(INOREADER_CLIENT_ID "" CACHE STRING "Inoreader client ID") +set(INOREADER_CLIENT_SECRET "" CACHE STRING "Inoreader client secret") + +find_package(QT NAMES Qt6 Qt5 REQUIRED) +find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS + Core + Gui + LinguistTools + Network + Qml + Sql + Widgets + Xml +) + +if(QT_VERSION_MAJOR EQUAL 6) + find_package(Qt6 COMPONENTS Core5Compat REQUIRED) +endif() + +if(USE_WEBENGINE) + find_package(Qt${QT_VERSION_MAJOR} COMPONENTS WebEngineWidgets REQUIRED) + add_compile_definitions(USE_WEBENGINE) +endif() + +if(NOT OS2) + find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Multimedia REQUIRED) + macro(qt_add_resources) + qt_add_big_resources(${ARGN}) + endmacro() +endif() + +if(UNIX AND NOT APPLE AND NOT ANDROID) + find_package(Qt${QT_VERSION_MAJOR} COMPONENTS DBus REQUIRED) +endif() + +if(NOT FEEDLY_CLIENT_ID STREQUAL "" AND NOT FEEDLY_CLIENT_SECRET STREQUAL "") + add_compile_definitions( + FEEDLY_OFFICIAL_SUPPORT + FEEDLY_CLIENT_ID="${FEEDLY_CLIENT_ID}" + FEEDLY_CLIENT_SECRET="${FEEDLY_CLIENT_SECRET}" + ) +else() + message(STATUS "Feedly client ID/secret variables are not set. Disabling official support") +endif() + +if(NOT GMAIL_CLIENT_ID STREQUAL "" AND NOT GMAIL_CLIENT_SECRET STREQUAL "") + add_compile_definitions( + GMAIL_OFFICIAL_SUPPORT + GMAIL_CLIENT_ID="${GMAIL_CLIENT_ID}" + GMAIL_CLIENT_SECRET="${GMAIL_CLIENT_SECRET}" + ) +else() + message(STATUS "GMail client ID/secret variables are not set. Disabling official support") +endif() + +if(NOT INOREADER_CLIENT_ID STREQUAL "" AND NOT INOREADER_CLIENT_SECRET STREQUAL "") + add_compile_definitions( + INOREADER_OFFICIAL_SUPPORT + INOREADER_CLIENT_ID="${INOREADER_CLIENT_ID}" + INOREADER_CLIENT_SECRET="${INOREADER_CLIENT_SECRET}" + ) +else() + message(STATUS "Inoreader client ID/secret variables are not set. Disabling official support") +endif() + +set(APP_NAME "RSS Guard") +set(APP_AUTHOR "") +set(APP_COPYRIGHT "") +set(APP_REVERSE_NAME "com.github.rssguard") +set(TYPEINFO "????") + +if(REVISION_FROM_GIT AND EXISTS "${CMAKE_SOURCE_DIR}/.git") + execute_process(COMMAND "git rev-parse --short HEAD" + WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" + OUTPUT_VARIABLE APP_REVISION + ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE + ) +else() + set(APP_REVISION "") +endif() + +if(NOT USE_WEBENGINE) + set(APP_REVISION "${APP_REVISION}-nowebengine") +endif() + +add_compile_definitions( + APP_AUTHOR="Martin Rotter" + APP_DONATE_URL="https://martinrotter.github.io/donate" + APP_EMAIL="rotter.martinos@gmail.com" + APP_LONG_NAME="${APP_NAME} ${CMAKE_PROJECT_VERSION}" + APP_LOW_H_NAME=".${CMAKE_PROJECT_NAME}" + APP_LOW_NAME="${CMAKE_PROJECT_NAME}" + APP_NAME="${APP_NAME}" + APP_REVISION="${APP_REVISON}" + APP_SYSTEM_NAME="${CMAKE_SYSTEM_NAME}" + APP_SYSTEM_VERSION="${CMAKE_SYSTEM_PROCESSOR}" + APP_URL="https://github.com/martinrotter/rssguard" + APP_URL_DOCUMENTATION="https://github.com/martinrotter/rssguard/blob/master/resources/docs/Documentation.md" + APP_URL_ISSUES="https://github.com/martinrotter/rssguard/issues" + APP_URL_ISSUES_NEW="https://github.com/martinrotter/rssguard/issues/new" + APP_USERAGENT="${APP_NAME}/${CMAKE_PROJECT_VERSION}" + APP_VERSION="${CMAKE_PROJECT_VERSION}" + + QT_USE_QSTRINGBUILDER + QT_USE_FAST_CONCATENATION + QT_USE_FAST_OPERATOR_PLUS + UNICODE _UNICODE +) + +if(UNIX) + add_compile_options(-fPIC) +endif() + +if(APPLE) + add_compile_options(-stdlib=libc++) + add_link_options(-stdlib=libc++) +endif() + +if(${FORCE_COLORED_OUTPUT}) + if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + add_compile_options(-fdiagnostics-color=always) + elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + add_compile_options(-fcolor-diagnostics) + endif() +endif() + +if(WIN32) + configure_file( + resources/rssguard.rc.in + ${CMAKE_BINARY_DIR}/rssguard.rc + NEWLINE_STYLE WIN32 + ) + configure_file( + resources/nsis/NSIS.definitions.nsh.in + ${CMAKE_BINARY_DIR}/NSIS.definitions.nsh + ) + file(COPY resources/nsis/NSIS.template.in DESTINATION ${CMAKE_BINARY_DIR}) + file(COPY resources/graphics/${CMAKE_PROJECT_NAME}.ico DESTINATION ${CMAKE_BINARY_DIR}) +elseif(APPLE) + configure_file( + resources/macosx/Info.plist.in + ${CMAKE_BINARY_DIR}/Info.plist + ) +endif() + +add_subdirectory(localization) +add_subdirectory(src/librssguard) +add_subdirectory(src/rssguard) diff --git a/build.pro b/build.pro deleted file mode 100644 index 1ce8ffe95..000000000 --- a/build.pro +++ /dev/null @@ -1,62 +0,0 @@ -################################################################# -# -# For license of this file, see /LICENSE.md. -# -# This is RSS Guard compilation script for qmake. -# -# Usage (out of source build type, we have two side by side folders: -# empty "build-dir" and RSS Guard repository "rssguard-dir"): -# a) DEBUG build for testing. -# cd build-dir -# qmake ../rssguard-dir/build.pro -r CONFIG+=debug PREFIX=./usr -# make -# make install -# -# b) RELEASE build for production use. -# cd build-dir -# qmake ../rssguard-dir/build.pro -r CONFIG+=release PREFIX=./usr -# make -# make install -# -# Variables: -# USE_WEBENGINE - if specified, then QtWebEngine module for internal web browser is used. -# Otherwise simple text component is used and some features will be disabled. -# Default value is "false". If QtWebEngine is installed during compilation, then -# value of this variable is tweaked automatically. -# PREFIX - specifies base folder to which files are copied during "make install" -# step, defaults to "$$OUT_PWD/usr" on Linux and to "$$OUT_PWD/app" on Windows. Behavior -# of this variable can be mimicked with $INSTALL_ROOT variable on Linux. Note that -# RSS Guard's installation is automatically relocatable, in other words, no -# absolute OS-dependent paths are used. -# {FEEDLY,GMAIL,INOREADER}_CLIENT_ID - preconfigured OAuth cliend ID. -# {FEEDLY,GMAIL,INOREADER}_CLIENT_SECRET - preconfigured OAuth cliend SECRET. -# -# Other information: -# - supports Windows, Linux, macOS, OS/2, Android, -# - Qt 5.9.0 or higher is required, -# - if you wish to make packages for Windows, then you must initialize all submodules within repository before compilation, -# - C++ 11/17 is required. -# -# Building on OS/2: -# RSS Guard can run on OS/2 and if you want to compile it by yourself, you need to make sure that -# your OS/2 distro is up-to-date and you have all dependencies installed: os2-base, all gcc-* packages, -# libc and libcx up-to-date, kbuild-make, ash, binutils, all relevant qt5-* packages. -# -# After your dependecies are installed, then you can compile via standard `qmake -> make -> make install` steps -# and package with: 7z.exe a -t7z -mmt -mx9 "rssguard.7z" " $$shell_quote($$PREFIX/Contents/Info.plist) && \ - rm -f $$shell_quote($$PREFIX/Contents/Info.plist.in) - info_plist2.path = $$quote($$PREFIX/Contents/) - - # Install PkgInfo - pkginfo.extra = @printf "APPL????" > $$shell_quote($$PREFIX/Contents/PkgInfo) - pkginfo.path = $$quote($$PREFIX/Contents/) - - INSTALLS += target lib icns_icon info_plist info_plist2 pkginfo - - INSTALL_HEADERS_PREFIX = $$shell_quote($$PREFIX/Contents/Resources/Include/librssguard) -} - -message($$MSG_PREFIX: Prefix for headers is \"$$INSTALL_HEADERS_PREFIX\".) - -# Create install step for each folder of public headers. -for(header, INSTALL_HEADERS) { - path = $${INSTALL_HEADERS_PREFIX}/$${dirname(header)} - path = $$shell_quote($$path) - - message($$MSG_PREFIX: Adding header \"$$header\" to \"make install\" step with path \"$$path\".) - - eval(headers_$${dirname(header)}.files += $$header) - eval(headers_$${dirname(header)}.path = $$path) - eval(INSTALLS *= headers_$${dirname(header)}) -} diff --git a/pri/vars.pri b/pri/vars.pri deleted file mode 100644 index 39bbe87da..000000000 --- a/pri/vars.pri +++ /dev/null @@ -1,75 +0,0 @@ -APP_NAME = "RSS Guard" -APP_LOW_NAME = "rssguard" -APP_REVERSE_NAME = "com.github.rssguard" -APP_LOW_H_NAME = ".rssguard" -APP_AUTHOR = "Martin Rotter" -APP_COPYRIGHT = "(C) 2011-2022 $$APP_AUTHOR" -APP_VERSION = "4.1.3" -APP_LONG_NAME = "$$APP_NAME $$APP_VERSION" -APP_EMAIL = "rotter.martinos@gmail.com" -APP_URL = "https://github.com/martinrotter/rssguard" -APP_URL_ISSUES = "https://github.com/martinrotter/rssguard/issues" -APP_URL_ISSUES_NEW = "https://github.com/martinrotter/rssguard/issues/new" -APP_URL_DOCUMENTATION = "https://github.com/martinrotter/rssguard/blob/master/resources/docs/Documentation.md" -APP_USERAGENT = "RSS Guard/$$APP_VERSION" -APP_DONATE_URL = "https://martinrotter.github.io/donate" - -message($$MSG_PREFIX: Welcome RSS Guard qmake script.) - -!versionAtLeast(QT_VERSION, 5.9.0) { - warning($$MSG_PREFIX: At least Qt \"5.9.0\" is required!!!) -} - -isEmpty(USE_WEBENGINE) { - USE_WEBENGINE = false - message($$MSG_PREFIX: USE_WEBENGINE variable is not set.) - - qtHaveModule(webenginewidgets) { - USE_WEBENGINE = true - } - else { - USE_WEBENGINE = false - } -} - -isEmpty(FEEDLY_CLIENT_ID)|isEmpty(FEEDLY_CLIENT_SECRET) { - FEEDLY_OFFICIAL_SUPPORT = false - - message($$MSG_PREFIX: Feedly client ID/secret variables are not set. Disabling official support.) -} -else { - FEEDLY_OFFICIAL_SUPPORT = true - DEFINES *= FEEDLY_OFFICIAL_SUPPORT - DEFINES *= FEEDLY_CLIENT_ID='"\\\"$$FEEDLY_CLIENT_ID\\\""' - DEFINES *= FEEDLY_CLIENT_SECRET='"\\\"$$FEEDLY_CLIENT_SECRET\\\""' - - message($$MSG_PREFIX: Enabling official Feedly support.) -} - -isEmpty(GMAIL_CLIENT_ID)|isEmpty(GMAIL_CLIENT_SECRET) { - GMAIL_OFFICIAL_SUPPORT = false - - message($$MSG_PREFIX: Gmail client ID/secret variables are not set.) -} -else { - GMAIL_OFFICIAL_SUPPORT = true - DEFINES *= GMAIL_OFFICIAL_SUPPORT - DEFINES *= GMAIL_CLIENT_ID='"\\\"$$GMAIL_CLIENT_ID\\\""' - DEFINES *= GMAIL_CLIENT_SECRET='"\\\"$$GMAIL_CLIENT_SECRET\\\""' - - message($$MSG_PREFIX: Enabling official Gmail support.) -} - -isEmpty(INOREADER_CLIENT_ID)|isEmpty(INOREADER_CLIENT_SECRET) { - INOREADER_OFFICIAL_SUPPORT = false - - message($$MSG_PREFIX: Inoreader client ID/secret variables are not set.) -} -else { - INOREADER_OFFICIAL_SUPPORT = true - DEFINES *= INOREADER_OFFICIAL_SUPPORT - DEFINES *= INOREADER_CLIENT_ID='"\\\"$$INOREADER_CLIENT_ID\\\""' - DEFINES *= INOREADER_CLIENT_SECRET='"\\\"$$INOREADER_CLIENT_SECRET\\\""' - - message($$MSG_PREFIX: Enabling official Inoreader support.) -} diff --git a/resources/macosx/Info.plist.in b/resources/macosx/Info.plist.in index 9ffa42f19..9924d7970 100644 --- a/resources/macosx/Info.plist.in +++ b/resources/macosx/Info.plist.in @@ -9,11 +9,11 @@ CFBundleDevelopmentRegion English CFBundleExecutable - @EXECUTABLE@ + @CMAKE_PROJECT_NAME@ CFBundleGetInfoString - @EXECUTABLE@ (C) 2011-2016 Martin Rotter + @CMAKE_PROJECT_NAME@ (C) 2011-2016 Martin Rotter CFBundleIconFile - @ICON@ + @CMAKE_PROJECT_NAME@.icns CFBundleIdentifier org.martinrotter.rssguard CFBundleInfoDictionaryVersion @@ -23,7 +23,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - @SHORT_VERSION@ + @CMAKE_PROJECT_VERSION@ CFBundleSignature @TYPEINFO@ CFBundleVersion diff --git a/resources/nsis/NSIS.definitions.nsh.in b/resources/nsis/NSIS.definitions.nsh.in index 546f7364e..cf2b30585 100644 --- a/resources/nsis/NSIS.definitions.nsh.in +++ b/resources/nsis/NSIS.definitions.nsh.in @@ -1,11 +1,11 @@ ; For license of this file, see /LICENSE.md. -!define VERSION "@APP_VERSION@" -!define APP_VERSION "@APP_VERSION@" +!define VERSION "@CMAKE_PROJECT_VERSION@" +!define APP_VERSION "@CMALE_PROJECT_VERSION@" !define APP_NAME "@APP_NAME@" -!define EXE_NAME "@EXE_NAME@" -!define LICENSE_FILE "@PWD@\..\..\resources\text\COPYING_GNU_GPL" -!define MUI_ICON "@PWD@\..\..\resources\graphics\@APP_LOW_NAME@.ico" -!define MUI_UNICON "@PWD@\..\..\resources\graphics\@APP_LOW_NAME@.ico" +!define EXE_NAME "@CMAKE_PROJECT_NAME@.exe" +!define LICENSE_FILE "@CMAKE_SOURCE_DIR@\resources\text\COPYING_GNU_GPL" +!define MUI_ICON "@CMAKE_SOURCE_DIR@\resources\graphics\@CMAKE_PROJECT_NAME@.ico" +!define MUI_UNICON "@CMAKE_SOURCE_DIR@\resources\graphics\@CMAKE_PROJECT_NAME@.ico" !define PATCH "0" -!define BINARY_TREE "@OUT_PWD@\app" \ No newline at end of file +!define BINARY_TREE "@CMAKE_BINARY_DIR@\app" diff --git a/resources/rssguard.rc.in b/resources/rssguard.rc.in new file mode 100644 index 000000000..b86e28cc1 --- /dev/null +++ b/resources/rssguard.rc.in @@ -0,0 +1,32 @@ +TYPELIB "versioninfo.rc" + +IDI_APPLICATION ICON "@CMAKE_PROJECT_NAME@.ico" + +VS_VERSION_INFO VERSIONINFO +FILEVERSION @PROJECT_VERSION_MAJOR@,@PROJECT_VERSION_MINOR@,@PROJECT_VERSION_PATCH@,0 +PRODUCTVERSION @PROJECT_VERSION_MAJOR@,@PROJECT_VERSION_MINOR@,@PROJECT_VERSION_PATCH@,0 +FILEFLAGSMASK 0x3fL +#ifdef _DEBUG +FILEFLAGS 0x1L +#else +FILEFLAGS 0x0L +#endif +FILEOS 0x4L +FILETYPE 0x2L +FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904e4" + BEGIN + VALUE "CompanyName", "@APP_AUTHOR@" + VALUE "FileDescription", "@APP_NAME@" + VALUE "FileVersion","@CMAKE_PROJECT_VERSION" + VALUE "InternalName", "@CMAKE_PROJECT_NAME@" + VALUE "LegalCopyright", "@APP_COPYRIGHT@" + VALUE "OriginalFilename", "@CMAKE_PROJECT_NAME@.exe" + VALUE "ProductName", "@APP_NAME@" + VALUE "ProductVersion","@CMAKE_PROJECT_VERSION" + END + END +END diff --git a/resources/scripts/github-actions/build-linux-mac.sh b/resources/scripts/github-actions/build-linux-mac.sh index c71a76ae5..7a4d61d7e 100755 --- a/resources/scripts/github-actions/build-linux-mac.sh +++ b/resources/scripts/github-actions/build-linux-mac.sh @@ -7,9 +7,11 @@ webengine="$2" if [[ "$os" == *"ubuntu"* ]]; then echo "We are building for GNU/Linux on Ubuntu." is_linux=true + prefix="AppDir/usr" else echo "We are building for macOS." is_linux=false + prefix="RSS Guard.app" fi echo "OS: $os; WebEngine: $webengine" @@ -19,8 +21,8 @@ if [ $is_linux = true ]; then sudo add-apt-repository ppa:beineri/opt-qt-5.15.2-bionic -y sudo apt-get update - sudo apt-get -y install qt515tools qt515base qt515webengine qt515svg qt515multimedia - sudo apt-get -y install openssl libssl-dev libgl1-mesa-dev gstreamer1.0-alsa gstreamer1.0-plugins-good gstreamer1.0-plugins-base gstreamer1.0-plugins-bad gstreamer1.0-qt5 gstreamer1.0-pulseaudio + sudo apt-get -qy install qt515tools qt515base qt515webengine qt515svg qt515multimedia + sudo apt-get -qy install cmake ninja-build openssl libssl-dev libgl1-mesa-dev gstreamer1.0-alsa gstreamer1.0-plugins-good gstreamer1.0-plugins-base gstreamer1.0-plugins-bad gstreamer1.0-qt5 gstreamer1.0-pulseaudio source /opt/qt515/bin/qt515-env.sh else @@ -34,33 +36,34 @@ else echo "Qt will be installed to: $QTPATH" aqt install-qt -O "$QTPATH" "mac" "desktop" "$QTVERSION" "clang_64" -m "qtwebengine" + aqt install-tool -O "$QTPATH" "mac" "desktop" "tools_cmake" + aqt install-tool -O "$QTPATH" "mac" "desktop" "tools_ninja" export QT_PLUGIN_PATH="$QTPATH/$QTVERSION/clang_64/plugins" - export PATH="$QTBIN:$PATH" + export PATH="$QTBIN:$QTPATH/Tools/CMake/bin:$QTPATH/Tools/Ninja:$PATH" fi -qmake --version +cmake --version # Build application and package it. -git_tag=$(git describe --tags `git rev-list --tags --max-count=1`) +git_tag=$(git describe --tags $(git rev-list --tags --max-count=1)) git_revision=$(git rev-parse --short HEAD) mkdir rssguard-build && cd rssguard-build -qmake .. "USE_WEBENGINE=$webengine" "FEEDLY_CLIENT_ID=$FEEDLY_CLIENT_ID" "FEEDLY_CLIENT_SECRET=$FEEDLY_CLIENT_SECRET" "GMAIL_CLIENT_ID=$GMAIL_CLIENT_ID" "GMAIL_CLIENT_SECRET=$GMAIL_CLIENT_SECRET" "INOREADER_CLIENT_ID=$INOREADER_CLIENT_ID" "INOREADER_CLIENT_SECRET=$INOREADER_CLIENT_SECRET" -make -make install -cd "src/rssguard" - +cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release -DREVISION_FROM_GIT=ON -DUSE_WEBENGINE="$webengine" -DFEEDLY_CLIENT_ID="$FEEDLY_CLIENT_ID" -DFEEDLY_CLIENT_SECRET="$FEEDLY_CLIENT_SECRET" -DGMAIL_CLIENT_ID="$GMAIL_CLIENT_ID" -DGMAIL_CLIENT_SECRET="$GMAIL_CLIENT_SECRET" -DINOREADER_CLIENT_ID="$INOREADER_CLIENT_ID" -DINOREADER_CLIENT_SECRET="$INOREADER_CLIENT_SECRET" +cmake --build . +cmake --install . --prefix "$prefix" + if [ $is_linux = true ]; then # Obtain linuxdeployqt. - wget -c https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage + wget -qc https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage chmod a+x linuxdeployqt-continuous-x86_64.AppImage # Copy Gstreamer libs. install -v -Dm755 "/usr/lib/x86_64-linux-gnu/gstreamer1.0/gstreamer-1.0/gst-plugin-scanner" "AppDir/usr/lib/gstreamer1.0/gstreamer-1.0/gst-plugin-scanner" gst_executables="-executable=AppDir/usr/lib/gstreamer1.0/gstreamer-1.0/gst-plugin-scanner" - for plugin in $(ls /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgst*.so); do + for plugin in /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgst*.so; do basen=$(basename "$plugin") install -v -Dm755 "$plugin" "AppDir/usr/lib/gstreamer-1.0/$basen" gst_executables="${gst_executables} -executable=AppDir/usr/lib/gstreamer-1.0/$basen" @@ -73,7 +76,7 @@ if [ $is_linux = true ]; then ./linuxdeployqt-continuous-x86_64.AppImage "./AppDir/usr/share/applications/com.github.rssguard.desktop" -bundle-non-qt-libs -no-translations $gst_executables ./linuxdeployqt-continuous-x86_64.AppImage "./AppDir/usr/share/applications/com.github.rssguard.desktop" -bundle-non-qt-libs -no-translations $gst_executables - if [[ "$webengine" == "true" ]]; then + if [[ "$webengine" == "ON" ]]; then # Copy some NSS3 files to prevent WebEngine crashes. cp /usr/lib/x86_64-linux-gnu/nss/* ./AppDir/usr/lib/ -v fi @@ -84,7 +87,7 @@ if [ $is_linux = true ]; then set -- R*.AppImage imagename="$1" - if [[ "$webengine" == "true" ]]; then + if [[ "$webengine" == "ON" ]]; then imagenewname="rssguard-${git_tag}-${git_revision}-linux64.AppImage" else imagenewname="rssguard-${git_tag}-${git_revision}-nowebengine-linux64.AppImage" @@ -92,7 +95,6 @@ if [ $is_linux = true ]; then else # Fix .dylib linking. install_name_tool -change "librssguard.dylib" "@executable_path/librssguard.dylib" "RSS Guard.app/Contents/MacOS/rssguard" - install_name_tool -change "librssguard.dylib" "@executable_path/librssguard.dylib" "rssguard" otool -L "RSS Guard.app/Contents/MacOS/rssguard" macdeployqt "./RSS Guard.app" -dmg diff --git a/resources/scripts/github-actions/build-windows.ps1 b/resources/scripts/github-actions/build-windows.ps1 index c252cb940..cb29c4462 100755 --- a/resources/scripts/github-actions/build-windows.ps1 +++ b/resources/scripts/github-actions/build-windows.ps1 @@ -76,14 +76,12 @@ cd "$old_pwd" # Build application. mkdir "rssguard-build" cd "rssguard-build" -& "$qt_qmake" "..\build.pro" "-r" "USE_WEBENGINE=$webengine" "FEEDLY_CLIENT_ID=$env:FEEDLY_CLIENT_ID" "FEEDLY_CLIENT_SECRET=$env:FEEDLY_CLIENT_SECRET" "GMAIL_CLIENT_ID=$env:GMAIL_CLIENT_ID" "GMAIL_CLIENT_SECRET=$env:GMAIL_CLIENT_SECRET" "INOREADER_CLIENT_ID=$env:INOREADER_CLIENT_ID" "INOREADER_CLIENT_SECRET=$env:INOREADER_CLIENT_SECRET" "CONFIG-=debug" "CONFIG-=debug_and_release" "CONFIG*=release" -nmake.exe - -cd "src\rssguard" -nmake.exe install +& "$cmake_path" ".." -G Ninja -DCMAKE_BUILD_TYPE="Release" -DREVISION_FROM_GIT=ON -DUSE_WEBENGINE="$webengine" -DFEEDLY_CLIENT_ID="$env:FEEDLY_CLIENT_ID" -DFEEDLY_CLIENT_SECRET="$env:FEEDLY_CLIENT_SECRET" -DGMAIL_CLIENT_ID="$env:GMAIL_CLIENT_ID" -DGMAIL_CLIENT_SECRET="$env:GMAIL_CLIENT_SECRET" -DINOREADER_CLIENT_ID="$env:INOREADER_CLIENT_ID" -DINOREADER_CLIENT_SECRET="$env:INOREADER_CLIENT_SECRET" +& "$cmake_path" --build . +& "$cmake_path" --install . --prefix app cd "app" -windeployqt.exe --verbose 1 --no-compiler-runtime --no-translations --release rssguard.exe librssguard.dll +windeployqt.exe --verbose 1 --no-compiler-runtime --no-translations --release rssguard.exe rssguard.dll cd ".." # Copy OpenSSL. @@ -94,7 +92,7 @@ Copy-Item -Path "$openssl_base_path\bin\libssl*.dll" -Destination ".\app\" Copy-Item -Path "$maria_path\lib\libmariadb.dll" -Destination ".\app\" Copy-Item -Path "$qt_sqldrivers_path\plugins\sqldrivers\qsqlmysql.dll" -Destination ".\app\sqldrivers\" -Force -if ($webengine -eq "true") { +if ($webengine -eq "ON") { $packagebase = "rssguard-${git_tag}-${git_revision}-win64" } else { @@ -107,4 +105,4 @@ else { # Create NSIS installation package. & "$old_pwd\resources\scripts\nsis\makensis.exe" "/XOutFile $packagebase.exe" ".\NSIS.template.in" -ls \ No newline at end of file +ls diff --git a/src/librssguard/CMakeLists.txt b/src/librssguard/CMakeLists.txt new file mode 100644 index 000000000..b2921a60c --- /dev/null +++ b/src/librssguard/CMakeLists.txt @@ -0,0 +1,548 @@ +set(SOURCES + core/feeddownloader.cpp + core/feeddownloader.h + core/feedsmodel.cpp + core/feedsmodel.h + core/feedsproxymodel.cpp + core/feedsproxymodel.h + core/filterutils.cpp + core/filterutils.h + core/message.cpp + core/message.h + core/messagefilter.cpp + core/messagefilter.h + core/messageobject.cpp + core/messageobject.h + core/messagesforfiltersmodel.cpp + core/messagesforfiltersmodel.h + core/messagesmodel.cpp + core/messagesmodel.h + core/messagesmodelcache.cpp + core/messagesmodelcache.h + core/messagesmodelsqllayer.cpp + core/messagesmodelsqllayer.h + core/messagesproxymodel.cpp + core/messagesproxymodel.h + database/databasecleaner.cpp + database/databasecleaner.h + database/databasedriver.cpp + database/databasedriver.h + database/databasefactory.cpp + database/databasefactory.h + database/databasequeries.cpp + database/databasequeries.h + database/mariadbdriver.cpp + database/mariadbdriver.h + database/sqlitedriver.cpp + database/sqlitedriver.h + definitions/definitions.h + definitions/typedefs.h + dynamic-shortcuts/dynamicshortcuts.cpp + dynamic-shortcuts/dynamicshortcuts.h + dynamic-shortcuts/dynamicshortcutswidget.cpp + dynamic-shortcuts/dynamicshortcutswidget.h + dynamic-shortcuts/shortcutcatcher.cpp + dynamic-shortcuts/shortcutcatcher.h + exceptions/applicationexception.cpp + exceptions/applicationexception.h + exceptions/feedfetchexception.cpp + exceptions/feedfetchexception.h + exceptions/filteringexception.cpp + exceptions/filteringexception.h + exceptions/ioexception.cpp + exceptions/ioexception.h + exceptions/networkexception.cpp + exceptions/networkexception.h + exceptions/scriptexception.cpp + exceptions/scriptexception.h + gui/dialogs/formabout.cpp + gui/dialogs/formabout.h + gui/dialogs/formaddaccount.cpp + gui/dialogs/formaddaccount.h + gui/dialogs/formaddeditlabel.cpp + gui/dialogs/formaddeditlabel.h + gui/dialogs/formbackupdatabasesettings.cpp + gui/dialogs/formbackupdatabasesettings.h + gui/dialogs/formdatabasecleanup.cpp + gui/dialogs/formdatabasecleanup.h + gui/dialogs/formmain.cpp + gui/dialogs/formmain.h + gui/dialogs/formmessagefiltersmanager.cpp + gui/dialogs/formmessagefiltersmanager.h + gui/dialogs/formrestoredatabasesettings.cpp + gui/dialogs/formrestoredatabasesettings.h + gui/dialogs/formsettings.cpp + gui/dialogs/formsettings.h + gui/dialogs/formupdate.cpp + gui/dialogs/formupdate.h + gui/feedmessageviewer.cpp + gui/feedmessageviewer.h + gui/feedsview.cpp + gui/feedsview.h + gui/guiutilities.cpp + gui/guiutilities.h + gui/messagebox.cpp + gui/messagebox.h + gui/messagepreviewer.cpp + gui/messagepreviewer.h + gui/messagesview.cpp + gui/messagesview.h + gui/newspaperpreviewer.cpp + gui/newspaperpreviewer.h + gui/notifications/notificationseditor.cpp + gui/notifications/notificationseditor.h + gui/notifications/singlenotificationeditor.cpp + gui/notifications/singlenotificationeditor.h + gui/reusable/baselineedit.cpp + gui/reusable/baselineedit.h + gui/reusable/basetreeview.cpp + gui/reusable/basetreeview.h + gui/reusable/colortoolbutton.cpp + gui/reusable/colortoolbutton.h + gui/reusable/comboboxwithstatus.cpp + gui/reusable/comboboxwithstatus.h + gui/reusable/edittableview.cpp + gui/reusable/edittableview.h + gui/reusable/helpspoiler.cpp + gui/reusable/helpspoiler.h + gui/reusable/labelsmenu.cpp + gui/reusable/labelsmenu.h + gui/reusable/labelwithstatus.cpp + gui/reusable/labelwithstatus.h + gui/reusable/lineeditwithstatus.cpp + gui/reusable/lineeditwithstatus.h + gui/reusable/messagecountspinbox.cpp + gui/reusable/messagecountspinbox.h + gui/reusable/networkproxydetails.cpp + gui/reusable/networkproxydetails.h + gui/reusable/nonclosablemenu.cpp + gui/reusable/nonclosablemenu.h + gui/reusable/plaintoolbutton.cpp + gui/reusable/plaintoolbutton.h + gui/reusable/progressbarwithtext.cpp + gui/reusable/progressbarwithtext.h + gui/reusable/resizablestackedwidget.cpp + gui/reusable/resizablestackedwidget.h + gui/reusable/searchtextwidget.cpp + gui/reusable/searchtextwidget.h + gui/reusable/squeezelabel.cpp + gui/reusable/squeezelabel.h + gui/reusable/styleditemdelegatewithoutfocus.cpp + gui/reusable/styleditemdelegatewithoutfocus.h + gui/reusable/timespinbox.cpp + gui/reusable/timespinbox.h + gui/reusable/treeviewcolumnsmenu.cpp + gui/reusable/treeviewcolumnsmenu.h + gui/reusable/widgetwithstatus.cpp + gui/reusable/widgetwithstatus.h + gui/settings/settingsbrowsermail.cpp + gui/settings/settingsbrowsermail.h + gui/settings/settingsdatabase.cpp + gui/settings/settingsdatabase.h + gui/settings/settingsdownloads.cpp + gui/settings/settingsdownloads.h + gui/settings/settingsfeedsmessages.cpp + gui/settings/settingsfeedsmessages.h + gui/settings/settingsgeneral.cpp + gui/settings/settingsgeneral.h + gui/settings/settingsgui.cpp + gui/settings/settingsgui.h + gui/settings/settingslocalization.cpp + gui/settings/settingslocalization.h + gui/settings/settingsnodejs.cpp + gui/settings/settingsnodejs.h + gui/settings/settingsnotifications.cpp + gui/settings/settingsnotifications.h + gui/settings/settingspanel.cpp + gui/settings/settingspanel.h + gui/settings/settingsshortcuts.cpp + gui/settings/settingsshortcuts.h + gui/systemtrayicon.cpp + gui/systemtrayicon.h + gui/tabbar.cpp + gui/tabbar.h + gui/tabcontent.cpp + gui/tabcontent.h + gui/tabwidget.cpp + gui/tabwidget.h + gui/toolbars/basetoolbar.cpp + gui/toolbars/basetoolbar.h + gui/toolbars/feedstoolbar.cpp + gui/toolbars/feedstoolbar.h + gui/toolbars/messagestoolbar.cpp + gui/toolbars/messagestoolbar.h + gui/toolbars/statusbar.cpp + gui/toolbars/statusbar.h + gui/toolbars/toolbareditor.cpp + gui/toolbars/toolbareditor.h + miscellaneous/application.cpp + miscellaneous/application.h + miscellaneous/autosaver.cpp + miscellaneous/autosaver.h + miscellaneous/externaltool.cpp + miscellaneous/externaltool.h + miscellaneous/feedreader.cpp + miscellaneous/feedreader.h + miscellaneous/iconfactory.cpp + miscellaneous/iconfactory.h + miscellaneous/iofactory.cpp + miscellaneous/iofactory.h + miscellaneous/localization.cpp + miscellaneous/localization.h + miscellaneous/mutex.cpp + miscellaneous/mutex.h + miscellaneous/nodejs.cpp + miscellaneous/nodejs.h + miscellaneous/notification.cpp + miscellaneous/notification.h + miscellaneous/notificationfactory.cpp + miscellaneous/notificationfactory.h + miscellaneous/regexfactory.cpp + miscellaneous/regexfactory.h + miscellaneous/settings.cpp + miscellaneous/settings.h + miscellaneous/settingsproperties.h + miscellaneous/singleapplication.cpp + miscellaneous/singleapplication.h + miscellaneous/skinfactory.cpp + miscellaneous/skinfactory.h + miscellaneous/systemfactory.cpp + miscellaneous/systemfactory.h + miscellaneous/templates.h + miscellaneous/textfactory.cpp + miscellaneous/textfactory.h + network-web/basenetworkaccessmanager.cpp + network-web/basenetworkaccessmanager.h + network-web/cookiejar.cpp + network-web/cookiejar.h + network-web/downloader.cpp + network-web/downloader.h + network-web/downloadmanager.cpp + network-web/downloadmanager.h + network-web/httpresponse.cpp + network-web/httpresponse.h + network-web/networkfactory.cpp + network-web/networkfactory.h + network-web/oauth2service.cpp + network-web/oauth2service.h + network-web/oauthhttphandler.cpp + network-web/oauthhttphandler.h + network-web/silentnetworkaccessmanager.cpp + network-web/silentnetworkaccessmanager.h + network-web/webfactory.cpp + network-web/webfactory.h + services/abstract/accountcheckmodel.cpp + services/abstract/accountcheckmodel.h + services/abstract/cacheforserviceroot.cpp + services/abstract/cacheforserviceroot.h + services/abstract/category.cpp + services/abstract/category.h + services/abstract/feed.cpp + services/abstract/feed.h + services/abstract/gui/authenticationdetails.cpp + services/abstract/gui/authenticationdetails.h + services/abstract/gui/formaccountdetails.cpp + services/abstract/gui/formaccountdetails.h + services/abstract/gui/formcategorydetails.cpp + services/abstract/gui/formcategorydetails.h + services/abstract/gui/formfeeddetails.cpp + services/abstract/gui/formfeeddetails.h + services/abstract/importantnode.cpp + services/abstract/importantnode.h + services/abstract/label.cpp + services/abstract/label.h + services/abstract/labelsnode.cpp + services/abstract/labelsnode.h + services/abstract/recyclebin.cpp + services/abstract/recyclebin.h + services/abstract/rootitem.cpp + services/abstract/rootitem.h + services/abstract/serviceentrypoint.h + services/abstract/serviceroot.cpp + services/abstract/serviceroot.h + services/abstract/unreadnode.cpp + services/abstract/unreadnode.h + services/feedly/definitions.h + services/feedly/feedlyentrypoint.cpp + services/feedly/feedlyentrypoint.h + services/feedly/feedlynetwork.cpp + services/feedly/feedlynetwork.h + services/feedly/feedlyserviceroot.cpp + services/feedly/feedlyserviceroot.h + services/feedly/gui/feedlyaccountdetails.cpp + services/feedly/gui/feedlyaccountdetails.h + services/feedly/gui/formeditfeedlyaccount.cpp + services/feedly/gui/formeditfeedlyaccount.h + services/gmail/definitions.h + services/gmail/gmailentrypoint.cpp + services/gmail/gmailentrypoint.h + services/gmail/gmailnetworkfactory.cpp + services/gmail/gmailnetworkfactory.h + services/gmail/gmailserviceroot.cpp + services/gmail/gmailserviceroot.h + services/gmail/gui/emailrecipientcontrol.cpp + services/gmail/gui/emailrecipientcontrol.h + services/gmail/gui/formaddeditemail.cpp + services/gmail/gui/formaddeditemail.h + services/gmail/gui/formdownloadattachment.cpp + services/gmail/gui/formdownloadattachment.h + services/gmail/gui/formeditgmailaccount.cpp + services/gmail/gui/formeditgmailaccount.h + services/gmail/gui/gmailaccountdetails.cpp + services/gmail/gui/gmailaccountdetails.h + services/greader/definitions.h + services/greader/greaderentrypoint.cpp + services/greader/greaderentrypoint.h + services/greader/greadernetwork.cpp + services/greader/greadernetwork.h + services/greader/greaderserviceroot.cpp + services/greader/greaderserviceroot.h + services/greader/gui/formeditgreaderaccount.cpp + services/greader/gui/formeditgreaderaccount.h + services/greader/gui/greaderaccountdetails.cpp + services/greader/gui/greaderaccountdetails.h + services/owncloud/definitions.h + services/owncloud/gui/formeditowncloudaccount.cpp + services/owncloud/gui/formeditowncloudaccount.h + services/owncloud/gui/owncloudaccountdetails.cpp + services/owncloud/gui/owncloudaccountdetails.h + services/owncloud/owncloudfeed.cpp + services/owncloud/owncloudfeed.h + services/owncloud/owncloudnetworkfactory.cpp + services/owncloud/owncloudnetworkfactory.h + services/owncloud/owncloudserviceentrypoint.cpp + services/owncloud/owncloudserviceentrypoint.h + services/owncloud/owncloudserviceroot.cpp + services/owncloud/owncloudserviceroot.h + services/reddit/definitions.h + services/reddit/gui/formeditredditaccount.cpp + services/reddit/gui/formeditredditaccount.h + services/reddit/gui/redditaccountdetails.cpp + services/reddit/gui/redditaccountdetails.h + services/reddit/redditcategory.cpp + services/reddit/redditcategory.h + services/reddit/redditentrypoint.cpp + services/reddit/redditentrypoint.h + services/reddit/redditnetworkfactory.cpp + services/reddit/redditnetworkfactory.h + services/reddit/redditserviceroot.cpp + services/reddit/redditserviceroot.h + services/reddit/redditsubscription.cpp + services/reddit/redditsubscription.h + services/standard/atomparser.cpp + services/standard/atomparser.h + services/standard/definitions.h + services/standard/feedparser.cpp + services/standard/feedparser.h + services/standard/gui/formeditstandardaccount.cpp + services/standard/gui/formeditstandardaccount.h + services/standard/gui/formstandardfeeddetails.cpp + services/standard/gui/formstandardfeeddetails.h + services/standard/gui/formstandardimportexport.cpp + services/standard/gui/formstandardimportexport.h + services/standard/gui/standardfeeddetails.cpp + services/standard/gui/standardfeeddetails.h + services/standard/jsonparser.cpp + services/standard/jsonparser.h + services/standard/rdfparser.cpp + services/standard/rdfparser.h + services/standard/rssparser.cpp + services/standard/rssparser.h + services/standard/standardcategory.cpp + services/standard/standardcategory.h + services/standard/standardfeed.cpp + services/standard/standardfeed.h + services/standard/standardfeedsimportexportmodel.cpp + services/standard/standardfeedsimportexportmodel.h + services/standard/standardserviceentrypoint.cpp + services/standard/standardserviceentrypoint.h + services/standard/standardserviceroot.cpp + services/standard/standardserviceroot.h + services/tt-rss/definitions.h + services/tt-rss/gui/formeditttrssaccount.cpp + services/tt-rss/gui/formeditttrssaccount.h + services/tt-rss/gui/formttrssfeeddetails.cpp + services/tt-rss/gui/formttrssfeeddetails.h + services/tt-rss/gui/formttrssnote.cpp + services/tt-rss/gui/formttrssnote.h + services/tt-rss/gui/ttrssaccountdetails.cpp + services/tt-rss/gui/ttrssaccountdetails.h + services/tt-rss/gui/ttrssfeeddetails.cpp + services/tt-rss/gui/ttrssfeeddetails.h + services/tt-rss/ttrssfeed.cpp + services/tt-rss/ttrssfeed.h + services/tt-rss/ttrssnetworkfactory.cpp + services/tt-rss/ttrssnetworkfactory.h + services/tt-rss/ttrssnotetopublish.h + services/tt-rss/ttrssserviceentrypoint.cpp + services/tt-rss/ttrssserviceentrypoint.h + services/tt-rss/ttrssserviceroot.cpp + services/tt-rss/ttrssserviceroot.h +) + +# Add mimesis +list(APPEND SOURCES + 3rd-party/mimesis/mimesis.cpp + 3rd-party/mimesis/mimesis.hpp + 3rd-party/mimesis/quoted-printable.cpp + 3rd-party/mimesis/quoted-printable.hpp +) + +# Add boolinq +list(APPEND SOURCES + 3rd-party/boolinq/boolinq.h +) + +# Add SimpleCrypt. +list(APPEND SOURCES + 3rd-party/sc/simplecrypt.cpp + 3rd-party/sc/simplecrypt.h +) + +if(APPLE) + list(APPEND SOURCES + miscellaneous/disablewindowtabbing.mm + ) +endif() + +if(USE_WEBENGINE) + list(APPEND SOURCES + gui/reusable/discoverfeedsbutton.cpp + gui/reusable/discoverfeedsbutton.h + gui/reusable/locationlineedit.cpp + gui/reusable/locationlineedit.h + gui/webbrowser.cpp + gui/webbrowser.h + gui/webviewer.cpp + gui/webviewer.h + network-web/googlesuggest.cpp + network-web/googlesuggest.h + network-web/webpage.cpp + network-web/webpage.h + + # Add AdBlock sources + network-web/adblock/adblockdialog.cpp + network-web/adblock/adblockdialog.h + network-web/adblock/adblockicon.cpp + network-web/adblock/adblockicon.h + network-web/adblock/adblockmanager.cpp + network-web/adblock/adblockmanager.h + network-web/adblock/adblockrequestinfo.cpp + network-web/adblock/adblockrequestinfo.h + network-web/adblock/adblockurlinterceptor.cpp + network-web/adblock/adblockurlinterceptor.h + network-web/networkurlinterceptor.cpp + network-web/networkurlinterceptor.h + network-web/urlinterceptor.h + ) +else() + list(APPEND SOURCES + gui/messagetextbrowser.cpp + gui/messagetextbrowser.h + gui/messagebrowser.cpp + gui/messagebrowser.h + ) +endif() + +qt_add_resources(SOURCES ${CMAKE_SOURCE_DIR}/resources/sql.qrc) +qt_add_resources(SOURCES ${CMAKE_SOURCE_DIR}/resources/rssguard.qrc) + +if(APPLE OR WIN32 OR OS2) + qt_add_resources(SOURCES ${CMAKE_SOURCE_DIR}/resources/icons.qrc) +endif() + +add_library(rssguard SHARED ${SOURCES} ${QM_FILES}) + +target_compile_definitions(rssguard PRIVATE RSSGUARD_DLLSPEC=Q_DECL_EXPORT) + +target_include_directories(rssguard + PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/gui + ${CMAKE_CURRENT_SOURCE_DIR}/gui/dialogs + ${CMAKE_CURRENT_SOURCE_DIR}/gui/reusable + ${CMAKE_CURRENT_SOURCE_DIR}/dynamic-shortcuts + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/gui/notifications + ${CMAKE_CURRENT_SOURCE_DIR}/gui/toolbars +) + +target_link_libraries(rssguard PUBLIC + Qt::Core + Qt::Gui + Qt::Network + Qt::Qml + Qt::Sql + Qt::Widgets + Qt::Xml +) + +if(QT_VERSION_MAJOR EQUAL 6) + target_link_libraries(rssguard PUBLIC + Qt::Core5Compat + ) +endif() + +if(USE_WEBENGINE) + target_link_libraries(rssguard PUBLIC + Qt::WebEngineWidgets + ) +endif() + +if(NOT OS2) + target_link_libraries(rssguard PUBLIC + Qt::Multimedia + ) +endif() + +if(UNIX AND NOT APPLE AND NOT ANDROID) + target_link_libraries(rssguard PUBLIC + Qt::DBus + ) +endif() + +if(APPLE) + target_compile_options(rssguard PUBLIC -mmacosx-version-min=10.8) + target_link_options(rssguard PUBLIC -mmacosx-version-min=10.8) + target_link_libraries(rssguard PUBLIC + "-framework AppKit" + ) +elseif(WIN32) + target_link_libraries(rssguard PUBLIC + Shell32.lib + odbc32 + ) +endif() + +if(WIN32 OR OS2) + install(TARGETS rssguard DESTINATION .) + install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + DESTINATION include + FILES_MATCHING PATTERN "services/abstract/*.h" + ) + install(DIRECTORY services/abstract + DESTINATION include/librssguard/services + FILES_MATCHING PATTERN "*.h" + ) +elseif(UNIX AND NOT APPLE AND NOT ANDROID) + include (GNUInstallDirs) + install(TARGETS rssguard + DESTINATION ${CMAKE_INSTALL_LIBDIR} + ) + install(DIRECTORY services/abstract + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/librssguard/services + FILES_MATCHING PATTERN "*.h" + ) +elseif(APPLE) + install(TARGETS rssguard + DESTINATION Contents/MacOS + ) + install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + DESTINATION Contents/Resources/Include + FILES_MATCHING PATTERN "services/abstract/*.h" + ) + install(DIRECTORY services/abstract + DESTINATION Contents/Resources/Include/librssguard/services + FILES_MATCHING PATTERN "*.h" + ) +endif() diff --git a/src/librssguard/librssguard.pro b/src/librssguard/librssguard.pro deleted file mode 100644 index 7bee40602..000000000 --- a/src/librssguard/librssguard.pro +++ /dev/null @@ -1,554 +0,0 @@ -TEMPLATE = lib - -unix|mac|os2 { - TARGET = rssguard -} -else { - TARGET = librssguard -} - -MSG_PREFIX = "librssguard" -APP_TYPE = "core library" - -include(../../pri/vars.pri) -include(../../pri/defs.pri) - -message($$MSG_PREFIX: Shadow copy build directory \"$$OUT_PWD\".) -message($$MSG_PREFIX: $$APP_NAME version is: \"$$APP_VERSION\".) -message($$MSG_PREFIX: Detected Qt version: \"$$QT_VERSION\".) -message($$MSG_PREFIX: Build destination directory: \"$$DESTDIR\".) -message($$MSG_PREFIX: Build revision: \"$$APP_REVISION\".) -message($$MSG_PREFIX: lrelease executable name: \"$$LRELEASE\".) - -include(../../pri/build_opts.pri) - -DEFINES *= RSSGUARD_DLLSPEC=Q_DECL_EXPORT -CONFIG += unversioned_libname unversioned_soname skip_target_version_ext - -RESOURCES += ../../resources/sql.qrc \ - ../../resources/rssguard.qrc - -mac|os2|win32 { - RESOURCES += ../../resources/icons.qrc -} - -HEADERS += core/feeddownloader.h \ - core/feedsmodel.h \ - core/feedsproxymodel.h \ - core/filterutils.h \ - core/message.h \ - core/messagefilter.h \ - core/messageobject.h \ - core/messagesforfiltersmodel.h \ - core/messagesmodel.h \ - core/messagesmodelcache.h \ - core/messagesmodelsqllayer.h \ - core/messagesproxymodel.h \ - database/databasecleaner.h \ - database/databasedriver.h \ - database/databasefactory.h \ - database/databasequeries.h \ - database/mariadbdriver.h \ - database/sqlitedriver.h \ - definitions/definitions.h \ - definitions/typedefs.h \ - dynamic-shortcuts/dynamicshortcuts.h \ - dynamic-shortcuts/dynamicshortcutswidget.h \ - dynamic-shortcuts/shortcutcatcher.h \ - exceptions/applicationexception.h \ - exceptions/feedfetchexception.h \ - exceptions/filteringexception.h \ - exceptions/ioexception.h \ - exceptions/networkexception.h \ - exceptions/scriptexception.h \ - gui/notifications/notificationseditor.h \ - gui/notifications/singlenotificationeditor.h \ - gui/reusable/baselineedit.h \ - gui/reusable/basetreeview.h \ - gui/reusable/helpspoiler.h \ - gui/reusable/progressbarwithtext.h \ - gui/reusable/resizablestackedwidget.h \ - gui/settings/settingsnodejs.h \ - gui/settings/settingsnotifications.h \ - gui/toolbars/basetoolbar.h \ - gui/reusable/comboboxwithstatus.h \ - gui/reusable/colortoolbutton.h \ - gui/dialogs/formabout.h \ - gui/dialogs/formaddaccount.h \ - gui/dialogs/formaddeditlabel.h \ - gui/dialogs/formbackupdatabasesettings.h \ - gui/dialogs/formdatabasecleanup.h \ - gui/dialogs/formmain.h \ - gui/dialogs/formmessagefiltersmanager.h \ - gui/dialogs/formrestoredatabasesettings.h \ - gui/dialogs/formsettings.h \ - gui/dialogs/formupdate.h \ - gui/feedmessageviewer.h \ - gui/toolbars/feedstoolbar.h \ - gui/feedsview.h \ - gui/guiutilities.h \ - gui/reusable/labelsmenu.h \ - gui/reusable/labelwithstatus.h \ - gui/reusable/lineeditwithstatus.h \ - gui/reusable/squeezelabel.h \ - gui/reusable/edittableview.h \ - gui/messagebox.h \ - gui/reusable/messagecountspinbox.h \ - gui/messagepreviewer.h \ - gui/toolbars/messagestoolbar.h \ - gui/messagesview.h \ - gui/reusable/networkproxydetails.h \ - gui/newspaperpreviewer.h \ - gui/reusable/nonclosablemenu.h \ - gui/reusable/plaintoolbutton.h \ - gui/reusable/searchtextwidget.h \ - gui/settings/settingsbrowsermail.h \ - gui/settings/settingsdatabase.h \ - gui/settings/settingsdownloads.h \ - gui/settings/settingsfeedsmessages.h \ - gui/settings/settingsgeneral.h \ - gui/settings/settingsgui.h \ - gui/settings/settingslocalization.h \ - gui/settings/settingspanel.h \ - gui/settings/settingsshortcuts.h \ - gui/toolbars/statusbar.h \ - gui/reusable/styleditemdelegatewithoutfocus.h \ - gui/systemtrayicon.h \ - gui/tabbar.h \ - gui/tabcontent.h \ - gui/tabwidget.h \ - gui/reusable/timespinbox.h \ - gui/toolbars/toolbareditor.h \ - gui/reusable/treeviewcolumnsmenu.h \ - gui/reusable/widgetwithstatus.h \ - miscellaneous/application.h \ - miscellaneous/autosaver.h \ - miscellaneous/externaltool.h \ - miscellaneous/feedreader.h \ - miscellaneous/iconfactory.h \ - miscellaneous/iofactory.h \ - miscellaneous/localization.h \ - miscellaneous/mutex.h \ - miscellaneous/nodejs.h \ - miscellaneous/notification.h \ - miscellaneous/notificationfactory.h \ - miscellaneous/regexfactory.h \ - miscellaneous/settings.h \ - miscellaneous/settingsproperties.h \ - miscellaneous/singleapplication.h \ - miscellaneous/skinfactory.h \ - miscellaneous/systemfactory.h \ - miscellaneous/templates.h \ - miscellaneous/textfactory.h \ - network-web/basenetworkaccessmanager.h \ - network-web/cookiejar.h \ - network-web/downloader.h \ - network-web/downloadmanager.h \ - network-web/httpresponse.h \ - network-web/networkfactory.h \ - network-web/oauth2service.h \ - network-web/oauthhttphandler.h \ - network-web/silentnetworkaccessmanager.h \ - network-web/webfactory.h \ - services/abstract/accountcheckmodel.h \ - services/abstract/cacheforserviceroot.h \ - services/abstract/category.h \ - services/abstract/feed.h \ - services/abstract/gui/authenticationdetails.h \ - services/abstract/gui/formaccountdetails.h \ - services/abstract/gui/formcategorydetails.h \ - services/abstract/gui/formfeeddetails.h \ - services/abstract/importantnode.h \ - services/abstract/label.h \ - services/abstract/labelsnode.h \ - services/abstract/recyclebin.h \ - services/abstract/rootitem.h \ - services/abstract/serviceentrypoint.h \ - services/abstract/serviceroot.h \ - services/abstract/unreadnode.h \ - services/feedly/definitions.h \ - services/feedly/feedlyentrypoint.h \ - services/feedly/feedlynetwork.h \ - services/feedly/feedlyserviceroot.h \ - services/feedly/gui/feedlyaccountdetails.h \ - services/feedly/gui/formeditfeedlyaccount.h \ - services/gmail/definitions.h \ - services/gmail/gmailentrypoint.h \ - services/gmail/gmailnetworkfactory.h \ - services/gmail/gmailserviceroot.h \ - services/gmail/gui/emailrecipientcontrol.h \ - services/gmail/gui/formaddeditemail.h \ - services/gmail/gui/formdownloadattachment.h \ - services/gmail/gui/formeditgmailaccount.h \ - services/gmail/gui/gmailaccountdetails.h \ - services/greader/definitions.h \ - services/greader/greaderentrypoint.h \ - services/greader/greadernetwork.h \ - services/greader/greaderserviceroot.h \ - services/greader/gui/formeditgreaderaccount.h \ - services/greader/gui/greaderaccountdetails.h \ - services/owncloud/definitions.h \ - services/owncloud/gui/formeditowncloudaccount.h \ - services/owncloud/gui/owncloudaccountdetails.h \ - services/owncloud/owncloudfeed.h \ - services/owncloud/owncloudnetworkfactory.h \ - services/owncloud/owncloudserviceentrypoint.h \ - services/owncloud/owncloudserviceroot.h \ - services/reddit/definitions.h \ - services/reddit/gui/formeditredditaccount.h \ - services/reddit/gui/redditaccountdetails.h \ - services/reddit/redditcategory.h \ - services/reddit/redditentrypoint.h \ - services/reddit/redditnetworkfactory.h \ - services/reddit/redditserviceroot.h \ - services/reddit/redditsubscription.h \ - services/standard/atomparser.h \ - services/standard/definitions.h \ - services/standard/feedparser.h \ - services/standard/gui/formeditstandardaccount.h \ - services/standard/gui/formstandardfeeddetails.h \ - services/standard/gui/formstandardimportexport.h \ - services/standard/gui/standardfeeddetails.h \ - services/standard/jsonparser.h \ - services/standard/rdfparser.h \ - services/standard/rssparser.h \ - services/standard/standardcategory.h \ - services/standard/standardfeed.h \ - services/standard/standardfeedsimportexportmodel.h \ - services/standard/standardserviceentrypoint.h \ - services/standard/standardserviceroot.h \ - services/tt-rss/definitions.h \ - services/tt-rss/gui/formeditttrssaccount.h \ - services/tt-rss/gui/formttrssfeeddetails.h \ - services/tt-rss/gui/formttrssnote.h \ - services/tt-rss/gui/ttrssaccountdetails.h \ - services/tt-rss/gui/ttrssfeeddetails.h \ - services/tt-rss/ttrssfeed.h \ - services/tt-rss/ttrssnetworkfactory.h \ - services/tt-rss/ttrssnotetopublish.h \ - services/tt-rss/ttrssserviceentrypoint.h \ - services/tt-rss/ttrssserviceroot.h - -SOURCES += core/feeddownloader.cpp \ - core/feedsmodel.cpp \ - core/feedsproxymodel.cpp \ - core/filterutils.cpp \ - core/message.cpp \ - core/messagefilter.cpp \ - core/messageobject.cpp \ - core/messagesforfiltersmodel.cpp \ - core/messagesmodel.cpp \ - core/messagesmodelcache.cpp \ - core/messagesmodelsqllayer.cpp \ - core/messagesproxymodel.cpp \ - database/databasecleaner.cpp \ - database/databasedriver.cpp \ - database/databasefactory.cpp \ - database/databasequeries.cpp \ - database/mariadbdriver.cpp \ - database/sqlitedriver.cpp \ - dynamic-shortcuts/dynamicshortcuts.cpp \ - dynamic-shortcuts/dynamicshortcutswidget.cpp \ - dynamic-shortcuts/shortcutcatcher.cpp \ - exceptions/applicationexception.cpp \ - exceptions/feedfetchexception.cpp \ - exceptions/filteringexception.cpp \ - exceptions/ioexception.cpp \ - exceptions/networkexception.cpp \ - exceptions/scriptexception.cpp \ - gui/notifications/notificationseditor.cpp \ - gui/notifications/singlenotificationeditor.cpp \ - gui/reusable/baselineedit.cpp \ - gui/reusable/basetreeview.cpp \ - gui/reusable/helpspoiler.cpp \ - gui/reusable/progressbarwithtext.cpp \ - gui/reusable/resizablestackedwidget.cpp \ - gui/settings/settingsnodejs.cpp \ - gui/settings/settingsnotifications.cpp \ - gui/toolbars/basetoolbar.cpp \ - gui/reusable/comboboxwithstatus.cpp \ - gui/reusable/colortoolbutton.cpp \ - gui/dialogs/formabout.cpp \ - gui/dialogs/formaddaccount.cpp \ - gui/dialogs/formaddeditlabel.cpp \ - gui/dialogs/formbackupdatabasesettings.cpp \ - gui/dialogs/formdatabasecleanup.cpp \ - gui/dialogs/formmain.cpp \ - gui/dialogs/formmessagefiltersmanager.cpp \ - gui/dialogs/formrestoredatabasesettings.cpp \ - gui/dialogs/formsettings.cpp \ - gui/dialogs/formupdate.cpp \ - gui/feedmessageviewer.cpp \ - gui/toolbars/feedstoolbar.cpp \ - gui/feedsview.cpp \ - gui/guiutilities.cpp \ - gui/reusable/labelsmenu.cpp \ - gui/reusable/edittableview.cpp \ - gui/reusable/labelwithstatus.cpp \ - gui/reusable/squeezelabel.cpp \ - gui/reusable/lineeditwithstatus.cpp \ - gui/messagebox.cpp \ - gui/reusable/messagecountspinbox.cpp \ - gui/messagepreviewer.cpp \ - gui/toolbars/messagestoolbar.cpp \ - gui/messagesview.cpp \ - gui/reusable/networkproxydetails.cpp \ - gui/newspaperpreviewer.cpp \ - gui/reusable/nonclosablemenu.cpp \ - gui/reusable/plaintoolbutton.cpp \ - gui/reusable/searchtextwidget.cpp \ - gui/settings/settingsbrowsermail.cpp \ - gui/settings/settingsdatabase.cpp \ - gui/settings/settingsdownloads.cpp \ - gui/settings/settingsfeedsmessages.cpp \ - gui/settings/settingsgeneral.cpp \ - gui/settings/settingsgui.cpp \ - gui/settings/settingslocalization.cpp \ - gui/settings/settingspanel.cpp \ - gui/settings/settingsshortcuts.cpp \ - gui/toolbars/statusbar.cpp \ - gui/reusable/styleditemdelegatewithoutfocus.cpp \ - gui/systemtrayicon.cpp \ - gui/tabbar.cpp \ - gui/tabcontent.cpp \ - gui/tabwidget.cpp \ - gui/reusable/timespinbox.cpp \ - gui/toolbars/toolbareditor.cpp \ - gui/reusable/treeviewcolumnsmenu.cpp \ - gui/reusable/widgetwithstatus.cpp \ - miscellaneous/application.cpp \ - miscellaneous/autosaver.cpp \ - miscellaneous/externaltool.cpp \ - miscellaneous/feedreader.cpp \ - miscellaneous/iconfactory.cpp \ - miscellaneous/iofactory.cpp \ - miscellaneous/localization.cpp \ - miscellaneous/mutex.cpp \ - miscellaneous/nodejs.cpp \ - miscellaneous/notification.cpp \ - miscellaneous/notificationfactory.cpp \ - miscellaneous/regexfactory.cpp \ - miscellaneous/settings.cpp \ - miscellaneous/singleapplication.cpp \ - miscellaneous/skinfactory.cpp \ - miscellaneous/systemfactory.cpp \ - miscellaneous/textfactory.cpp \ - network-web/basenetworkaccessmanager.cpp \ - network-web/cookiejar.cpp \ - network-web/downloader.cpp \ - network-web/downloadmanager.cpp \ - network-web/httpresponse.cpp \ - network-web/networkfactory.cpp \ - network-web/oauth2service.cpp \ - network-web/oauthhttphandler.cpp \ - network-web/silentnetworkaccessmanager.cpp \ - network-web/webfactory.cpp \ - services/abstract/accountcheckmodel.cpp \ - services/abstract/cacheforserviceroot.cpp \ - services/abstract/category.cpp \ - services/abstract/feed.cpp \ - services/abstract/gui/authenticationdetails.cpp \ - services/abstract/gui/formaccountdetails.cpp \ - services/abstract/gui/formcategorydetails.cpp \ - services/abstract/gui/formfeeddetails.cpp \ - services/abstract/importantnode.cpp \ - services/abstract/label.cpp \ - services/abstract/labelsnode.cpp \ - services/abstract/recyclebin.cpp \ - services/abstract/rootitem.cpp \ - services/abstract/serviceroot.cpp \ - services/abstract/unreadnode.cpp \ - services/feedly/feedlyentrypoint.cpp \ - services/feedly/feedlynetwork.cpp \ - services/feedly/feedlyserviceroot.cpp \ - services/feedly/gui/feedlyaccountdetails.cpp \ - services/feedly/gui/formeditfeedlyaccount.cpp \ - services/gmail/gmailentrypoint.cpp \ - services/gmail/gmailnetworkfactory.cpp \ - services/gmail/gmailserviceroot.cpp \ - services/gmail/gui/emailrecipientcontrol.cpp \ - services/gmail/gui/formaddeditemail.cpp \ - services/gmail/gui/formdownloadattachment.cpp \ - services/gmail/gui/formeditgmailaccount.cpp \ - services/gmail/gui/gmailaccountdetails.cpp \ - services/greader/greaderentrypoint.cpp \ - services/greader/greadernetwork.cpp \ - services/greader/greaderserviceroot.cpp \ - services/greader/gui/formeditgreaderaccount.cpp \ - services/greader/gui/greaderaccountdetails.cpp \ - services/owncloud/gui/formeditowncloudaccount.cpp \ - services/owncloud/gui/owncloudaccountdetails.cpp \ - services/owncloud/owncloudfeed.cpp \ - services/owncloud/owncloudnetworkfactory.cpp \ - services/owncloud/owncloudserviceentrypoint.cpp \ - services/owncloud/owncloudserviceroot.cpp \ - services/reddit/gui/formeditredditaccount.cpp \ - services/reddit/gui/redditaccountdetails.cpp \ - services/reddit/redditcategory.cpp \ - services/reddit/redditentrypoint.cpp \ - services/reddit/redditnetworkfactory.cpp \ - services/reddit/redditserviceroot.cpp \ - services/reddit/redditsubscription.cpp \ - services/standard/atomparser.cpp \ - services/standard/feedparser.cpp \ - services/standard/gui/formeditstandardaccount.cpp \ - services/standard/gui/formstandardfeeddetails.cpp \ - services/standard/gui/formstandardimportexport.cpp \ - services/standard/gui/standardfeeddetails.cpp \ - services/standard/jsonparser.cpp \ - services/standard/rdfparser.cpp \ - services/standard/rssparser.cpp \ - services/standard/standardcategory.cpp \ - services/standard/standardfeed.cpp \ - services/standard/standardfeedsimportexportmodel.cpp \ - services/standard/standardserviceentrypoint.cpp \ - services/standard/standardserviceroot.cpp \ - services/tt-rss/gui/formeditttrssaccount.cpp \ - services/tt-rss/gui/formttrssfeeddetails.cpp \ - services/tt-rss/gui/formttrssnote.cpp \ - services/tt-rss/gui/ttrssaccountdetails.cpp \ - services/tt-rss/gui/ttrssfeeddetails.cpp \ - services/tt-rss/ttrssfeed.cpp \ - services/tt-rss/ttrssnetworkfactory.cpp \ - services/tt-rss/ttrssserviceentrypoint.cpp \ - services/tt-rss/ttrssserviceroot.cpp - -mac { - OBJECTIVE_SOURCES += miscellaneous/disablewindowtabbing.mm -} - -FORMS += gui/dialogs/formabout.ui \ - gui/dialogs/formaddaccount.ui \ - gui/dialogs/formaddeditlabel.ui \ - gui/dialogs/formbackupdatabasesettings.ui \ - gui/dialogs/formdatabasecleanup.ui \ - gui/dialogs/formmain.ui \ - gui/dialogs/formmessagefiltersmanager.ui \ - gui/dialogs/formrestoredatabasesettings.ui \ - gui/dialogs/formsettings.ui \ - gui/dialogs/formupdate.ui \ - gui/notifications/notificationseditor.ui \ - gui/notifications/singlenotificationeditor.ui \ - gui/reusable/networkproxydetails.ui \ - gui/newspaperpreviewer.ui \ - gui/reusable/searchtextwidget.ui \ - gui/settings/settingsbrowsermail.ui \ - gui/settings/settingsdatabase.ui \ - gui/settings/settingsdownloads.ui \ - gui/settings/settingsfeedsmessages.ui \ - gui/settings/settingsgeneral.ui \ - gui/settings/settingsgui.ui \ - gui/settings/settingslocalization.ui \ - gui/settings/settingsnodejs.ui \ - gui/settings/settingsnotifications.ui \ - gui/settings/settingsshortcuts.ui \ - gui/toolbars/toolbareditor.ui \ - network-web/downloaditem.ui \ - network-web/downloadmanager.ui \ - services/abstract/gui/authenticationdetails.ui \ - services/abstract/gui/formaccountdetails.ui \ - services/abstract/gui/formcategorydetails.ui \ - services/abstract/gui/formfeeddetails.ui \ - services/feedly/gui/feedlyaccountdetails.ui \ - services/gmail/gui/formaddeditemail.ui \ - services/gmail/gui/formdownloadattachment.ui \ - services/gmail/gui/gmailaccountdetails.ui \ - services/greader/gui/greaderaccountdetails.ui \ - services/owncloud/gui/owncloudaccountdetails.ui \ - services/reddit/gui/redditaccountdetails.ui \ - services/standard/gui/formstandardimportexport.ui \ - services/standard/gui/standardfeeddetails.ui \ - services/tt-rss/gui/formttrssnote.ui \ - services/tt-rss/gui/ttrssaccountdetails.ui \ - services/tt-rss/gui/ttrssfeeddetails.ui - - -equals(USE_WEBENGINE, true) { - HEADERS += gui/reusable/locationlineedit.h \ - gui/webviewer.h \ - gui/webbrowser.h \ - gui/reusable/discoverfeedsbutton.h \ - network-web/googlesuggest.h \ - network-web/webpage.h - - SOURCES += gui/reusable/locationlineedit.cpp \ - gui/webviewer.cpp \ - gui/webbrowser.cpp \ - gui/reusable/discoverfeedsbutton.cpp \ - network-web/googlesuggest.cpp \ - network-web/webpage.cpp - - # Add AdBlock sources. - HEADERS += \ - network-web/adblock/adblockdialog.h \ - network-web/adblock/adblockicon.h \ - network-web/adblock/adblockmanager.h \ - network-web/adblock/adblockurlinterceptor.h \ - network-web/adblock/adblockrequestinfo.h \ - network-web/urlinterceptor.h \ - network-web/networkurlinterceptor.h - - SOURCES += \ - network-web/adblock/adblockdialog.cpp \ - network-web/adblock/adblockicon.cpp \ - network-web/adblock/adblockmanager.cpp \ - network-web/adblock/adblockurlinterceptor.cpp \ - network-web/adblock/adblockrequestinfo.cpp \ - network-web/networkurlinterceptor.cpp - - FORMS += \ - network-web/adblock/adblockdialog.ui -} -else { - HEADERS += gui/messagetextbrowser.h \ - gui/messagebrowser.h - SOURCES += gui/messagetextbrowser.cpp \ - gui/messagebrowser.cpp -} - -# Add mimesis. -SOURCES += $$files(3rd-party/mimesis/*.cpp, false) -HEADERS += $$files(3rd-party/mimesis/*.hpp, false) - -# Add boolinq. -HEADERS += $$files(3rd-party/boolinq/*.h, false) - -# Add SimpleCrypt. -SOURCES += $$files(3rd-party/sc/*.cpp, false) -HEADERS += $$files(3rd-party/sc/*.h, false) - - -INCLUDEPATH += $$PWD/. \ - $$PWD/gui \ - $$PWD/gui/dialogs \ - $$PWD/gui/reusable \ - $$PWD/gui/toolbars \ - $$PWD/gui/notifications \ - $$PWD/dynamic-shortcuts - -TRANSLATIONS += $$files($$PWD/../../localization/rssguard_*.ts, false) \ - $$files($$PWD/../../localization/qtbase_*.ts, false) - -load(uic) -uic.commands -= -no-stringliteral - -TR_EXCLUDE += $(QTDIR) - -# Create new "make lupdate" target. -lupdate.target = lupdate -lupdate.commands = lupdate -no-obsolete -pro $$shell_quote($$shell_path($$PWD/librssguard.pro)) -ts $$shell_quote($$shell_path($$PWD/../../localization/rssguard_en.ts)) - -QMAKE_EXTRA_TARGETS += lupdate - -# Make sure QM translations are nerated. -qtPrepareTool(LRELEASE, lrelease) { - message($$MSG_PREFIX: Running: \"$$LRELEASE\" -compress $$TRANSLATIONS) - system($$LRELEASE -compress $$TRANSLATIONS) -} - -mac { - IDENTIFIER = $$APP_REVERSE_NAME - CONFIG -= app_bundle - QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.8 - LIBS += -framework AppKit -} diff --git a/src/librssguard/services/reddit/gui/formeditredditaccount.h b/src/librssguard/services/reddit/gui/formeditredditaccount.h index 51618a790..7811bd19a 100644 --- a/src/librssguard/services/reddit/gui/formeditredditaccount.h +++ b/src/librssguard/services/reddit/gui/formeditredditaccount.h @@ -1,7 +1,7 @@ // For license of this file, see /LICENSE.md. -#ifndef FORMEDITINOREADERACCOUNT_H -#define FORMEDITINOREADERACCOUNT_H +#ifndef FORMEDITREDDITACCOUNT_H +#define FORMEDITREDDITACCOUNT_H #include "services/abstract/gui/formaccountdetails.h" @@ -26,4 +26,4 @@ class FormEditRedditAccount : public FormAccountDetails { RedditAccountDetails* m_details; }; -#endif // FORMEDITINOREADERACCOUNT_H +#endif // FORMEDITREDDITACCOUNT_H diff --git a/src/rssguard/CMakeLists.txt b/src/rssguard/CMakeLists.txt new file mode 100644 index 000000000..832d1ffc5 --- /dev/null +++ b/src/rssguard/CMakeLists.txt @@ -0,0 +1,91 @@ +# TODO: fix RC file + +#if(WIN32) + #enable_language("RC") + #add_executable(app main.cpp ${CMAKE_BINARY_DIR}/rssguard.rc) +#else() + #add_executable(app main.cpp) +#endif() + +add_executable(app main.cpp) + +target_compile_definitions(app PRIVATE RSSGUARD_DLLSPEC=Q_DECL_IMPORT) + +set_target_properties (app PROPERTIES OUTPUT_NAME ${CMAKE_PROJECT_NAME}) + +target_include_directories(app PUBLIC + ${CMAKE_BINARY_DIR}/src/librssguard/rssguard_autogen/include +) + +target_link_libraries(app PUBLIC + Qt::Core + Qt::Gui + Qt::Widgets + rssguard +) + +if(QT_VERSION_MAJOR EQUAL 6) + target_link_libraries(app PUBLIC + Qt::Core5Compat + ) +endif() + +if(APPLE) + target_compile_options(app PUBLIC -mmacosx-version-min=10.10) + target_link_options(app PUBLIC -mmacosx-version-min=10.10) + set_target_properties(app PROPERTIES + MACOSX_BUNDLE FALSE + ) +elseif(WIN32) + target_link_libraries(app PUBLIC + Shell32.lib + odbc32 + ) +endif() + +if(WIN32) + install(TARGETS app DESTINATION .) + install(FILES ${CMAKE_SOURCE_DIR}/resources/graphics/${CMAKE_PROJECT_NAME}.ico + DESTINATION . + ) + install(DIRECTORY ${CMAKE_SOURCE_DIR}/resources/scripts/redist + DESTINATION . + FILES_MATCHING PATTERN "*.dll" + ) + install(DIRECTORY ${CMAKE_SOURCE_DIR}/resources/scripts/clang-format + DESTINATION . + FILES_MATCHING PATTERN "*.exe" + ) +elseif(OS2) + install(TARGETS app DESTINATION .) +elseif(UNIX AND NOT APPLE AND NOT ANDROID) + include (GNUInstallDirs) + install(TARGETS app + DESTINATION ${CMAKE_INSTALL_BINDIR} + ) + install(FILES ${CMAKE_SOURCE_DIR}/resources/desktop/${APP_REVERSE_NAME}.desktop + DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications + ) + install(FILES ${CMAKE_SOURCE_DIR}/resources/desktop/${APP_REVERSE_NAME}.appdata.xml + DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/metainfo + ) + install(FILES ${CMAKE_SOURCE_DIR}/resources/graphics/${CMAKE_PROJECT_NAME}.png + DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/512x512/apps + ) +elseif(APPLE) + install(TARGETS app + DESTINATION Contents/MacOS + ) + install(FILES ${CMAKE_SOURCE_DIR}/resources/macosx/${CMAKE_PROJECT_NAME}.icns + DESTINATION Contents/Resources + ) + install(FILES + ${CMAKE_SOURCE_DIR}/resources/macosx/Info.plist.in + ${CMAKE_BINARY_DIR}/Info.plist + DESTINATION Contents + ) + file(WRITE PkgInfo "APPL????") + install(FILES PkgInfo + DESTINATION Contents + ) +endif() diff --git a/src/rssguard/rssguard.pro b/src/rssguard/rssguard.pro deleted file mode 100644 index 3ccf57e6f..000000000 --- a/src/rssguard/rssguard.pro +++ /dev/null @@ -1,64 +0,0 @@ -TEMPLATE = app -TARGET = rssguard - -MSG_PREFIX = "rssguard" -APP_TYPE = "executable" - -include(../../pri/vars.pri) - -isEmpty(PREFIX) { - message($$MSG_PREFIX: PREFIX variable is not set. This might indicate error.) - - win32|os2|android { - PREFIX = $$OUT_PWD/app - } - - mac { - PREFIX = $$quote($$OUT_PWD/$${APP_NAME}.app) - } - - unix:!mac:!android { - PREFIX = $$OUT_PWD/AppDir/usr - } -} - -include(../../pri/defs.pri) - -message($$MSG_PREFIX: Current directory \"$$PWD\".) -message($$MSG_PREFIX: Shadow copy build directory \"$$OUT_PWD\".) -message($$MSG_PREFIX: $$APP_NAME version is: \"$$APP_VERSION\".) -message($$MSG_PREFIX: Detected Qt version: \"$$QT_VERSION\".) -message($$MSG_PREFIX: Build destination directory: \"$$DESTDIR\".) -message($$MSG_PREFIX: Prefix directory: \"$$PREFIX\".) -message($$MSG_PREFIX: Build revision: \"$$APP_REVISION\".) - -include(../../pri/build_opts.pri) - -DEFINES *= RSSGUARD_DLLSPEC=Q_DECL_IMPORT -SOURCES += main.cpp -INCLUDEPATH += $$PWD/../librssguard \ - $$PWD/../librssguard/gui \ - $$PWD/../librssguard/gui/reusable \ - $$OUT_PWD/../librssguard \ - $$OUT_PWD/../librssguard/ui - -DEPENDPATH += $$PWD/../librssguard - -win32: LIBS += -L$$OUT_PWD/../librssguard/ -llibrssguard -mac: LIBS += -L$$OUT_PWD/../librssguard/ -lrssguard -unix:!mac: LIBS += $$OUT_PWD/../librssguard/librssguard.so -os2: LIBS += -L$$OUT_PWD/../librssguard/ -lrssguard - -win32 { - # Prepare files for NSIS. - SEDREPLACE = "| ForEach-Object { $_ -replace '@APP_VERSION@', '$$APP_VERSION' -replace '@APP_REVISION@', '$$APP_REVISION' -replace '@APP_NAME@', '$$APP_NAME' -replace '@APP_LOW_NAME@', '$$APP_LOW_NAME' -replace '@EXE_NAME@', '$${APP_LOW_NAME}.exe' -replace '@PWD@', '$$replace(PWD, /, \\\\)' -replace '@OUT_PWD@', '$$replace(OUT_PWD, /, \\\\)' }" - message($$MSG_PREFIX: Sed replace string: \"$$SEDREPLACE\") - - FULLSEDCMD = "powershell -Command \"cat $$shell_path($$shell_quote($$PWD/../../resources/nsis/NSIS.definitions.nsh.in)) $$SEDREPLACE | Out-File $$shell_path($$shell_quote($$OUT_PWD/NSIS.definitions.nsh))\"" - message($$MSG_PREFIX: Full powershell command: $$FULLSEDCMD) - - system(xcopy /Y $$shell_path($$shell_quote($$PWD/../../resources/nsis/NSIS.template.in)) $$shell_path($$shell_quote($$OUT_PWD/))) - system($$FULLSEDCMD) -} - -include(../../pri/install.pri)