You've already forked qBittorrent
mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-10-09 18:32:15 +02:00
Compare commits
168 Commits
release-4.
...
release-4.
Author | SHA1 | Date | |
---|---|---|---|
![]() |
29e9594859 | ||
![]() |
e881a42368 | ||
![]() |
67c6107892 | ||
![]() |
ea66edd1cb | ||
![]() |
cb444978ef | ||
![]() |
2794e883b6 | ||
![]() |
e86249a4e8 | ||
![]() |
6f45764629 | ||
![]() |
5250a8be42 | ||
![]() |
f3d878324b | ||
![]() |
43d9d16241 | ||
![]() |
5ad8f60ca1 | ||
![]() |
539fe7259e | ||
![]() |
6521d00d5b | ||
![]() |
e8010abc8b | ||
![]() |
99614aaa9d | ||
![]() |
56342c9c79 | ||
![]() |
efa748e853 | ||
![]() |
26ee009e72 | ||
![]() |
aff4065e42 | ||
![]() |
1c1cac2cba | ||
![]() |
ea3c360901 | ||
![]() |
39fe0025cd | ||
![]() |
3c17ad566c | ||
![]() |
97bfd13060 | ||
![]() |
3e91481672 | ||
![]() |
e131cd16a1 | ||
![]() |
a0976f4181 | ||
![]() |
5366bebb97 | ||
![]() |
f51cd36c29 | ||
![]() |
553f443fbc | ||
![]() |
97a92984c0 | ||
![]() |
f1489dc2bf | ||
![]() |
716aad9483 | ||
![]() |
8c91c03be2 | ||
![]() |
03e6b6e09d | ||
![]() |
75d3c03763 | ||
![]() |
f6b0abbd75 | ||
![]() |
03e8b9f74f | ||
![]() |
808f6ad9fb | ||
![]() |
4cf45aeebf | ||
![]() |
a0cf80c967 | ||
![]() |
56183ff5d9 | ||
![]() |
664dabdb7e | ||
![]() |
055d752c50 | ||
![]() |
3e4c2193fb | ||
![]() |
5c2b8d3e10 | ||
![]() |
ae9b8720af | ||
![]() |
30f2d11203 | ||
![]() |
9a69afb34a | ||
![]() |
923395b5c7 | ||
![]() |
9de819ea4a | ||
![]() |
21c8acd55c | ||
![]() |
709198d2f1 | ||
![]() |
87542b4f75 | ||
![]() |
566ecefbcf | ||
![]() |
41061f3c39 | ||
![]() |
703330c40d | ||
![]() |
5fdd069f66 | ||
![]() |
0ba8111c37 | ||
![]() |
5d206acb21 | ||
![]() |
7f1218a7c7 | ||
![]() |
c4ed7daf67 | ||
![]() |
5a09f996ed | ||
![]() |
dbde206ed4 | ||
![]() |
0947f93ad3 | ||
![]() |
f338d267bc | ||
![]() |
84aa63a3c5 | ||
![]() |
c2afc50c02 | ||
![]() |
f72e7c0a8f | ||
![]() |
575bde1d1d | ||
![]() |
d15fdf2dde | ||
![]() |
868fd53551 | ||
![]() |
66c2e70016 | ||
![]() |
89ee24fb3e | ||
![]() |
b02eb32806 | ||
![]() |
e162aef5be | ||
![]() |
837528c206 | ||
![]() |
b19153287b | ||
![]() |
544d3f9025 | ||
![]() |
7a463299ea | ||
![]() |
bbaa3a94c5 | ||
![]() |
d2834bd7fd | ||
![]() |
534549142e | ||
![]() |
5e73afa04e | ||
![]() |
6ad1ba1d35 | ||
![]() |
f978b3a002 | ||
![]() |
2f70d273b4 | ||
![]() |
2289bf4005 | ||
![]() |
0cd4900e92 | ||
![]() |
0ad8dc39e5 | ||
![]() |
60d133ca6d | ||
![]() |
000a726e20 | ||
![]() |
4006818520 | ||
![]() |
756bc3da54 | ||
![]() |
fbb01a36e6 | ||
![]() |
21922ed3b4 | ||
![]() |
43fe5214d2 | ||
![]() |
ab6079e0d5 | ||
![]() |
dc0b1ce227 | ||
![]() |
1db12e4421 | ||
![]() |
b160b56306 | ||
![]() |
0e6627b0f6 | ||
![]() |
33390bf463 | ||
![]() |
2a6ddffb22 | ||
![]() |
06c09f0113 | ||
![]() |
db258f7461 | ||
![]() |
81cec1930b | ||
![]() |
7444227c9a | ||
![]() |
07196571e8 | ||
![]() |
b083bd78e7 | ||
![]() |
e75a65d798 | ||
![]() |
e1a10a0375 | ||
![]() |
080c542953 | ||
![]() |
d7ab472363 | ||
![]() |
c4eb6eccaf | ||
![]() |
1c091cef76 | ||
![]() |
e37b08a879 | ||
![]() |
39018ef1db | ||
![]() |
c6cadb6800 | ||
![]() |
0898196a5f | ||
![]() |
4b40b80145 | ||
![]() |
6ade38400e | ||
![]() |
71ca3a5cc9 | ||
![]() |
2a3fc0ede1 | ||
![]() |
1b9fd85497 | ||
![]() |
c73f61c8d4 | ||
![]() |
4205e99479 | ||
![]() |
35c7e6bf2c | ||
![]() |
37bc47ee04 | ||
![]() |
c5dc361213 | ||
![]() |
0c83b3e3a3 | ||
![]() |
63c9e29419 | ||
![]() |
7389dc082f | ||
![]() |
1e05e6a842 | ||
![]() |
03550a0932 | ||
![]() |
85c1a9dbe0 | ||
![]() |
89de23718b | ||
![]() |
3760b63582 | ||
![]() |
621ee80539 | ||
![]() |
7589487c0c | ||
![]() |
ad7279953e | ||
![]() |
2bf340a89a | ||
![]() |
1d9df11e8c | ||
![]() |
118af03534 | ||
![]() |
596a71e03d | ||
![]() |
dab392645d | ||
![]() |
2d1fa9e154 | ||
![]() |
3a63fabe9c | ||
![]() |
3129712f03 | ||
![]() |
66baf64e17 | ||
![]() |
1bdeab398a | ||
![]() |
2bda2a37e3 | ||
![]() |
027b605fc0 | ||
![]() |
87e1c80e28 | ||
![]() |
2d3efbc711 | ||
![]() |
8e394e0cdb | ||
![]() |
0623c623d5 | ||
![]() |
307d8ec360 | ||
![]() |
5a518d2f35 | ||
![]() |
93fe20afcd | ||
![]() |
7f217110cd | ||
![]() |
4e7b33fadf | ||
![]() |
7926d1755f | ||
![]() |
3a13a3d5ca | ||
![]() |
caa8e1658a | ||
![]() |
890ccb7b84 | ||
![]() |
912b076707 |
@@ -3,7 +3,7 @@ version: '{branch}-{build}'
|
||||
# Do not build on tags (GitHub only)
|
||||
skip_tags: true
|
||||
|
||||
image: Visual Studio 2019
|
||||
image: Visual Studio 2017
|
||||
|
||||
branches:
|
||||
except: # blacklist
|
||||
@@ -42,7 +42,7 @@ install:
|
||||
|
||||
before_build:
|
||||
# setup env
|
||||
- CALL "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars32.bat"
|
||||
- CALL "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat"
|
||||
- SET PATH=%PATH%;c:\qbt\qt5_32\bin;%CACHE_DIR%\jom;
|
||||
# setup project
|
||||
- COPY /Y "%CACHE_DIR%\conf.pri" "%REPO_DIR%"
|
||||
|
1
.github/FUNDING.yml
vendored
1
.github/FUNDING.yml
vendored
@@ -1 +0,0 @@
|
||||
custom: "https://www.qbittorrent.org/donate.php"
|
1
.github/ISSUE_TEMPLATE.md
vendored
1
.github/ISSUE_TEMPLATE.md
vendored
@@ -17,3 +17,4 @@
|
||||
|
||||
### Extra info(if any)
|
||||
(type here)
|
||||
|
||||
|
240
.github/workflows/ci.yaml
vendored
240
.github/workflows/ci.yaml
vendored
@@ -1,240 +0,0 @@
|
||||
name: GitHub Actions CI
|
||||
|
||||
# Cache is used for all Windows and macOS dependencies (size approx. 1230 * 2 + 1850 = 4310 MiB)
|
||||
# Cache is not used for Ubuntu builds, because it already has all dependencies except
|
||||
# the appropriate libtorrent version, which only takes 3-5 minutes to build from source anyway
|
||||
|
||||
on: [pull_request, push]
|
||||
|
||||
env:
|
||||
VCPKG_COMMIT: e4ce66eecfd3e5cca5eac06c971921bf8e37cf88
|
||||
VCPKG_DEST_MACOS: /Users/runner/qbt_tools/vcpkg
|
||||
VCPKG_DEST_WIN: C:\qbt_tools\vcpkg
|
||||
LIBTORRENT_VERSION_TAG: v1.2.12
|
||||
|
||||
jobs:
|
||||
|
||||
ci_ubuntu:
|
||||
name: Ubuntu
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-20.04]
|
||||
qbt_gui: ["GUI=ON", "GUI=OFF"]
|
||||
fail-fast: false
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
steps:
|
||||
- name: checkout repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: install all build dependencies except libtorrent from Ubuntu repos
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install \
|
||||
build-essential cmake git ninja-build pkg-config \
|
||||
libssl-dev libgeoip-dev zlib1g-dev \
|
||||
libboost-dev libboost-chrono-dev libboost-random-dev libboost-system-dev \
|
||||
libqt5svg5-dev qtbase5-dev qttools5-dev
|
||||
|
||||
- name: install libtorrent from source
|
||||
run: |
|
||||
git clone https://github.com/arvidn/libtorrent && cd libtorrent
|
||||
git checkout ${{ env.LIBTORRENT_VERSION_TAG }}
|
||||
cmake -B cmake-build-dir -G "Ninja" \
|
||||
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||
-Ddeprecated-functions=OFF \
|
||||
--graphviz=cmake-build-dir/target_graph.dot
|
||||
cmake --build cmake-build-dir
|
||||
sudo cmake --install cmake-build-dir --prefix /usr/local
|
||||
|
||||
- name: build qBittorrent
|
||||
run: |
|
||||
cmake -B build -G "Ninja" \
|
||||
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||
-D${{ matrix.qbt_gui }} \
|
||||
-DVERBOSE_CONFIGURE=ON \
|
||||
--graphviz=build/target_graph.dot
|
||||
cmake --build build
|
||||
|
||||
- name: upload artifact as zip
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: qBittorrent-CI_${{ matrix.os }}-x64_${{ matrix.qbt_gui }}
|
||||
path: |
|
||||
build/compile_commands.json
|
||||
build/target_graph.dot
|
||||
build/qbittorrent
|
||||
build/qbittorrent-nox
|
||||
libtorrent/cmake-build-dir/compile_commands.json
|
||||
libtorrent/cmake-build-dir/target_graph.dot
|
||||
|
||||
ci_windows:
|
||||
name: Windows + vcpkg
|
||||
|
||||
runs-on: windows-2019
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: pwsh
|
||||
|
||||
steps:
|
||||
- name: checkout repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
# - ninja is needed for building qBittorrent (because it's preferrable, not a hard requirement)
|
||||
- name: install additional required packages with chocolatey
|
||||
run: |
|
||||
choco install ninja
|
||||
|
||||
- name: setup vcpkg (cached, if possible)
|
||||
uses: lukka/run-vcpkg@v4
|
||||
with:
|
||||
vcpkgDirectory: ${{ env.VCPKG_DEST_WIN }}
|
||||
vcpkgGitCommitId: ${{ env.VCPKG_COMMIT }}
|
||||
setupOnly: true
|
||||
|
||||
# Tell vcpkg to only build Release variants of the dependencies
|
||||
- name: configure vcpkg triplet overlay for release builds only
|
||||
run: |
|
||||
New-Item -Path ${{ github.workspace }} -Name "triplets_overlay" -ItemType Directory
|
||||
Copy-Item ${{ env.RUNVCPKG_VCPKG_ROOT }}/triplets/x64-windows-static.cmake `
|
||||
${{ github.workspace }}/triplets_overlay/x64-windows-static-release.cmake
|
||||
Add-Content ${{ github.workspace }}/triplets_overlay/x64-windows-static-release.cmake `
|
||||
-Value "set(VCPKG_BUILD_TYPE release)"
|
||||
|
||||
# clear buildtrees after each package installation to reduce disk space requirements
|
||||
- name: install dependencies via vcpkg
|
||||
run: |
|
||||
$packages = `
|
||||
"boost-circular-buffer:x64-windows-static-release",
|
||||
"libtorrent:x64-windows-static-release",
|
||||
"qt5-base:x64-windows-static-release",
|
||||
"qt5-svg:x64-windows-static-release",
|
||||
"qt5-tools:x64-windows-static-release",
|
||||
"qt5-winextras:x64-windows-static-release"
|
||||
${{ env.RUNVCPKG_VCPKG_ROOT }}/vcpkg.exe upgrade `
|
||||
--overlay-triplets=${{ github.workspace }}/triplets_overlay `
|
||||
--overlay-ports=${{ github.workspace }}/vcpkg `
|
||||
--no-dry-run
|
||||
foreach($package in $packages)
|
||||
{
|
||||
${{ env.RUNVCPKG_VCPKG_ROOT }}/vcpkg.exe install $package `
|
||||
--overlay-triplets=${{ github.workspace }}/triplets_overlay `
|
||||
--overlay-ports=${{ github.workspace }}/vcpkg `
|
||||
--clean-after-build
|
||||
}
|
||||
|
||||
# NOTE: this is necessary to correctly find and use cl.exe with the Ninja generator for now
|
||||
- name: setup devcmd
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
|
||||
- name: build qBittorrent
|
||||
shell: cmd
|
||||
run: |
|
||||
cmake -B build -G "Ninja" ^
|
||||
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo ^
|
||||
-DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_DEST_WIN }}\scripts\buildsystems\vcpkg.cmake ^
|
||||
-DVCPKG_TARGET_TRIPLET=x64-windows-static-release ^
|
||||
-DVERBOSE_CONFIGURE=ON ^
|
||||
-DMSVC_RUNTIME_DYNAMIC=OFF ^
|
||||
--graphviz=build\target_graph.dot
|
||||
cmake --build build
|
||||
|
||||
- name: upload artifact as zip
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: qBittorrent-CI_Windows-x64
|
||||
path: |
|
||||
build/compile_commands.json
|
||||
build/target_graph.dot
|
||||
build/qbittorrent.exe
|
||||
build/qbittorrent.pdb
|
||||
dist/windows/qt.conf
|
||||
|
||||
ci_macos:
|
||||
name: macOS + vcpkg
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
qbt_gui: ["GUI=ON", "GUI=OFF"]
|
||||
fail-fast: false
|
||||
|
||||
runs-on: macos-10.15
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: pwsh
|
||||
|
||||
steps:
|
||||
- name: checkout repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
# - ninja is needed for building qBittorrent (because it's preferrable, not a hard requirement)
|
||||
# - automake is needed for the installation the vcpkg installation of fontconfig, a dependency of qt5-base
|
||||
- name: install additional required packages with homebrew
|
||||
shell: bash
|
||||
run: |
|
||||
brew install automake ninja
|
||||
|
||||
- name: setup vcpkg (cached, if possible)
|
||||
uses: lukka/run-vcpkg@v4
|
||||
with:
|
||||
vcpkgDirectory: ${{ env.VCPKG_DEST_MACOS }}
|
||||
vcpkgGitCommitId: ${{ env.VCPKG_COMMIT }}
|
||||
setupOnly: true
|
||||
|
||||
- name: configure vcpkg triplet overlay for release builds only
|
||||
run: |
|
||||
New-Item -Path ${{ github.workspace }} -Name "triplets_overlay" -ItemType Directory
|
||||
Copy-Item ${{ env.RUNVCPKG_VCPKG_ROOT }}/triplets/x64-osx.cmake `
|
||||
${{ github.workspace }}/triplets_overlay/x64-osx-release.cmake
|
||||
Add-Content ${{ github.workspace }}/triplets_overlay/x64-osx-release.cmake `
|
||||
-Value "set(VCPKG_BUILD_TYPE release)","set(VCPKG_OSX_DEPLOYMENT_TARGET 10.15)"
|
||||
|
||||
- name: install dependencies via vcpkg
|
||||
run: |
|
||||
$packages = `
|
||||
"boost-circular-buffer:x64-osx-release",
|
||||
"libtorrent:x64-osx-release",
|
||||
"qt5-base:x64-osx-release",
|
||||
"qt5-svg:x64-osx-release",
|
||||
"qt5-tools:x64-osx-release",
|
||||
"qt5-macextras:x64-osx-release"
|
||||
${{ env.RUNVCPKG_VCPKG_ROOT }}/vcpkg upgrade `
|
||||
--overlay-triplets=${{ github.workspace }}/triplets_overlay `
|
||||
--overlay-ports=${{ github.workspace }}/vcpkg `
|
||||
--no-dry-run
|
||||
foreach($package in $packages)
|
||||
{
|
||||
${{ env.RUNVCPKG_VCPKG_ROOT }}/vcpkg install $package `
|
||||
--overlay-triplets=${{ github.workspace }}/triplets_overlay `
|
||||
--overlay-ports=${{ github.workspace }}/vcpkg `
|
||||
--clean-after-build
|
||||
}
|
||||
|
||||
- name: build qBittorrent
|
||||
shell: bash
|
||||
run: |
|
||||
cmake -B build -G "Ninja" -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||
-DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_DEST_MACOS }}/scripts/buildsystems/vcpkg.cmake \
|
||||
-DVCPKG_TARGET_TRIPLET=x64-osx-release \
|
||||
-D${{ matrix.qbt_gui }} \
|
||||
-DVERBOSE_CONFIGURE=ON \
|
||||
--graphviz=build/target_graph.dot
|
||||
cmake --build build
|
||||
|
||||
- name: upload artifact as zip
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: qBittorrent-CI_macOS_${{ matrix.qbt_gui }}
|
||||
path: |
|
||||
build/compile_commands.json
|
||||
build/target_graph.dot
|
||||
build/qbittorrent.app
|
||||
build/qbittorrent-nox.app
|
85
.github/workflows/file_health.sh
vendored
85
.github/workflows/file_health.sh
vendored
@@ -1,85 +0,0 @@
|
||||
#!/usr/bin/env zsh
|
||||
|
||||
set -o nounset
|
||||
|
||||
# Assumption: file names don't contain `:` (for the `cut` invocation).
|
||||
# Safe to assume, as such a character in a filename would cause trouble on Windows, a platform we support
|
||||
|
||||
# any regression turn this non-zero
|
||||
regressions=0
|
||||
|
||||
# exclusions (these are just grep extended regular expressions to match against paths relative to the root of the repository)
|
||||
exclusions_nonutf8='(.*(7z|gif|ic(ns|o)|png|qm|zip))'
|
||||
exclusions_bom='src/base/unicodestrings.h'
|
||||
exclusions_tw='(*.ts)|src/webui/www/private/scripts/lib/mootools-1.2-more.js'
|
||||
exclusions_trailing_newline='configure'
|
||||
exclusions_no_lf='(*.ts)|(.*svg)|compile_commands.json|src/webui/www/private/scripts/lib/mootools-1.2-(core-yc.js|more.js)'
|
||||
|
||||
echo -e "\n*** Detect files not encoded in UTF-8 ***\n"
|
||||
|
||||
find . -path ./build -prune -false -o -path ./.git -prune -false -o -type f -exec file --mime {} \; | sort \
|
||||
| grep -v -e "charset=us-ascii" -e "charset=utf-8" | cut -d ":" -f 1 \
|
||||
| grep -E -v -e "${exclusions_nonutf8}" \
|
||||
| tee >(echo -e "--> Files not encoded in UTF-8: found" "$(wc -l < /dev/stdin)" "regression(s)\n") \
|
||||
| xargs -I my_input -0 bash -c 'echo "my_input"; test "$(echo -n "my_input" | wc -l)" -eq 0'
|
||||
regressions=$((regressions+$?))
|
||||
|
||||
echo -e "\n*** Detect files encoded in UTF-8 with BOM ***\n"
|
||||
|
||||
grep --exclude-dir={.git,build} -rIl $'\xEF\xBB\xBF' | sort \
|
||||
| grep -E -v -e "${exclusions_bom}" \
|
||||
| tee >(echo -e "--> Files encoded in UTF-8 with BOM: found" "$(wc -l < /dev/stdin)" "regression(s)\n") \
|
||||
| xargs -I my_input -0 bash -c 'echo "my_input"; test "$(echo -n "my_input" | wc -l)" -eq 0'
|
||||
regressions=$((regressions+$?))
|
||||
|
||||
echo -e "\n*** Detect usage of CR byte ***\n"
|
||||
|
||||
grep --exclude-dir={.git,build} -rIlU $'\x0D' | sort \
|
||||
| tee >(echo -e "--> Usage of CR byte: found" "$(wc -l < /dev/stdin)" "regression(s)\n") \
|
||||
| xargs -I my_input -0 bash -c 'echo "my_input"; test "$(echo -n "my_input" | wc -l)" -eq 0'
|
||||
regressions=$((regressions+$?))
|
||||
|
||||
echo -e "\n*** Detect trailing whitespace in lines ***\n"
|
||||
|
||||
grep --exclude-dir={.git,build} -rIl "[[:blank:]]$" | sort \
|
||||
| grep -E -v -e "${exclusions_tw}" \
|
||||
| tee >(echo -e "--> Trailing whitespace in lines: found" "$(wc -l < /dev/stdin)" "regression(s)\n") \
|
||||
| xargs -I my_input -0 bash -c 'echo "my_input"; test "$(echo -n "my_input" | wc -l)" -eq 0';
|
||||
regressions=$((regressions+$?))
|
||||
|
||||
echo -e "\n*** Detect too many trailing newlines ***\n"
|
||||
|
||||
find . -path ./build -prune -false -o -path ./.git -prune -false -o -type f -exec file --mime {} \; | sort \
|
||||
| grep -e "charset=us-ascii" -e "charset=utf-8" | cut -d ":" -f 1 \
|
||||
| grep -E -v -e "${exclusions_trailing_newline}" \
|
||||
| xargs -L1 -I my_input bash -c 'test "$(tail -q -c2 "my_input" | hexdump -C | grep "0a 0a")" && echo "my_input"' \
|
||||
| tee >(echo -e "--> Too many trailing newlines: found" "$(wc -l < /dev/stdin)" "regression(s)\n") \
|
||||
| xargs -I my_input -0 bash -c 'echo "my_input"; test "$(echo -n "my_input" | wc -l)" -eq 0'
|
||||
regressions=$((regressions+$?))
|
||||
|
||||
echo -e "\n*** Detect no trailing newline ***\n"
|
||||
|
||||
find . -path ./build -prune -false -o -path ./.git -prune -false -o -type f -exec file --mime {} \; | sort \
|
||||
| grep -e "charset=us-ascii" -e "charset=utf-8" | cut -d ":" -f 1 \
|
||||
| grep -E -v -e "${exclusions_no_lf}" \
|
||||
| xargs -L1 -I my_input bash -c 'test "$(tail -q -c1 "my_input" | hexdump -C | grep "0a")" || echo "my_input"' \
|
||||
| tee >(echo -e "--> No trailing newline: found" "$(wc -l < /dev/stdin)" "regression(s)\n") \
|
||||
| xargs -I my_input -0 bash -c 'echo "my_input"; test "$(echo -n "my_input" | wc -l)" -eq 0'
|
||||
regressions=$((regressions+$?))
|
||||
|
||||
echo -e "\n*** Detect translation closing tag in new line ***\n"
|
||||
|
||||
grep --exclude-dir={.git,build} -nri "^</translation>" | sort \
|
||||
| cut -d ":" -f 1,2 \
|
||||
| tee >(echo -e "--> Translation closing tag in new line: found" "$(wc -l < /dev/stdin)" "regression(s)\n") \
|
||||
| xargs -I my_input -0 bash -c 'echo "my_input"; test "$(echo -n "my_input" | wc -l)" -eq 0'
|
||||
regressions=$((regressions+$?))
|
||||
|
||||
if [ "$regressions" -ne 0 ]; then
|
||||
regressions=1
|
||||
echo "\nFile health regressions found. Please fix them (or add them as exclusions)."
|
||||
else
|
||||
echo "All OK, no file health regressions found."
|
||||
fi
|
||||
|
||||
exit $regressions;
|
22
.github/workflows/file_health.yaml
vendored
22
.github/workflows/file_health.yaml
vendored
@@ -1,22 +0,0 @@
|
||||
name: GitHub Actions file health check
|
||||
|
||||
on: [pull_request, push]
|
||||
|
||||
jobs:
|
||||
check_file_health:
|
||||
name: Check file health
|
||||
|
||||
runs-on: ubuntu-20.04
|
||||
|
||||
steps:
|
||||
- name: checkout repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: install zsh
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install zsh
|
||||
|
||||
- name: run check file health script
|
||||
run: |
|
||||
./.github/workflows/file_health.sh
|
31
.github/workflows/webui_ci.yaml
vendored
31
.github/workflows/webui_ci.yaml
vendored
@@ -1,31 +0,0 @@
|
||||
name: WebUI CI
|
||||
|
||||
on: [pull_request, push]
|
||||
|
||||
jobs:
|
||||
check_webui:
|
||||
name: Check WebUI
|
||||
runs-on: ubuntu-20.04
|
||||
defaults:
|
||||
run:
|
||||
working-directory: src/webui/www
|
||||
|
||||
steps:
|
||||
- name: checkout repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: setup nodejs
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: '14'
|
||||
|
||||
- name: install tools
|
||||
run: npm install
|
||||
|
||||
- name: lint code
|
||||
run: npm run lint
|
||||
|
||||
- name: format code
|
||||
run: |
|
||||
npm run format
|
||||
git diff --exit-code
|
1
.gitignore
vendored
1
.gitignore
vendored
@@ -4,7 +4,6 @@ src/qbittorrent
|
||||
src/qbittorrent-nox
|
||||
src/release
|
||||
src/debug
|
||||
src/base/version.h
|
||||
CMakeLists.txt.user*
|
||||
qbittorrent.pro.user*
|
||||
conf.pri
|
||||
|
233
.travis.yml
Normal file
233
.travis.yml
Normal file
@@ -0,0 +1,233 @@
|
||||
language: cpp
|
||||
|
||||
os:
|
||||
- linux
|
||||
- osx
|
||||
|
||||
dist: xenial
|
||||
|
||||
env:
|
||||
matrix:
|
||||
- libt_branch=RC_1_2 gui=true build_system=qmake
|
||||
- libt_branch=RC_1_2 gui=false build_system=qmake
|
||||
- libt_branch=RC_1_2 gui=true build_system=cmake
|
||||
- libt_branch=RC_1_2 gui=false build_system=cmake
|
||||
- libt_branch=RC_1_1 gui=true build_system=qmake
|
||||
- libt_branch=RC_1_1 gui=false build_system=qmake
|
||||
- libt_branch=RC_1_1 gui=true build_system=cmake
|
||||
- libt_branch=RC_1_1 gui=false build_system=cmake
|
||||
global:
|
||||
- secure: "OI9CUjj4lTb0HwwIZU5PbECU3hLlAL6KC8KsbwohG8/O3j5fLcnmDsK4Ad9us5cC39sS11Jcd1kDP2qRcCuST/glVNhLkcjKkiQerOfd5nQ/qL4JYfz/1mfP5mdpz9jHKzpLUIG+TXkbSTjP6VVmsb5KPT+3pKEdRFZB+Pu9+J8="
|
||||
- coverity_branch: coverity_scan
|
||||
|
||||
matrix:
|
||||
allow_failures:
|
||||
- env: libt_branch=RC_1_2 gui=true build_system=cmake
|
||||
- env: libt_branch=RC_1_2 gui=false build_system=cmake
|
||||
- env: libt_branch=RC_1_1 gui=true build_system=cmake
|
||||
- env: libt_branch=RC_1_1 gui=false build_system=cmake
|
||||
|
||||
branches:
|
||||
except:
|
||||
- search_encoding_windows
|
||||
- v2_9_x
|
||||
|
||||
notifications:
|
||||
email:
|
||||
on_success: change
|
||||
on_failure: change
|
||||
|
||||
cache:
|
||||
ccache: true
|
||||
directories:
|
||||
- $HOME/travis/deb
|
||||
- $HOME/travis/brew
|
||||
|
||||
addons:
|
||||
coverity_scan:
|
||||
project:
|
||||
name: "qbittorrent/qBittorrent"
|
||||
description: "Build submitted via Travis CI"
|
||||
build_command_prepend: "./bootstrap.sh && ./configure $qmake_conf"
|
||||
build_command: "make -j2"
|
||||
branch_pattern: $coverity_branch
|
||||
notification_email: sledgehammer999@qbittorrent.org
|
||||
apt:
|
||||
sources:
|
||||
# sources list: https://github.com/travis-ci/apt-source-safelist/blob/master/ubuntu.json
|
||||
- sourceline: 'ppa:qbittorrent-team/qbittorrent-stable'
|
||||
- sourceline: 'ppa:beineri/opt-qt59-xenial'
|
||||
packages:
|
||||
# packages list: https://github.com/travis-ci/apt-package-safelist/blob/master/ubuntu-trusty
|
||||
- [autoconf, automake, colormake]
|
||||
- [libboost-dev, libboost-system-dev]
|
||||
- libssl-dev
|
||||
- libtorrent-rasterbar-dev
|
||||
- [qt59base, qt59svg, qt59tools]
|
||||
- zlib1g-dev
|
||||
# required for Qt 5.9 from 'beineri' PPA
|
||||
- libgl1-mesa-dev
|
||||
|
||||
before_install:
|
||||
# only allow specific build for coverity scan, others will stop
|
||||
- if [ "$TRAVIS_BRANCH" = "$coverity_branch" ] && ! [ "$TRAVIS_OS_NAME" = "linux" -a "$libt_branch" = "RC_1_2" -a "$gui" = "true" -a "$build_system" = "qmake" ]; then exit ; fi
|
||||
|
||||
- shopt -s expand_aliases
|
||||
- alias make="colormake -j2" # Using nprocs/2 sometimes may fail (gcc is killed by system)
|
||||
- qbt_path="$HOME/qbt_install"
|
||||
- qmake_conf="$qmake_conf --prefix=$qbt_path"
|
||||
- cmake_conf="$cmake_conf -DCMAKE_INSTALL_PREFIX=$qbt_path"
|
||||
|
||||
# options for specific branches
|
||||
- |
|
||||
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
|
||||
# setup virtual display for after_success target
|
||||
if [ "$gui" = "true" ]; then export "DISPLAY=:99.0" && /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x16 ; fi ;
|
||||
|
||||
# Qt 5.9
|
||||
PATH=/opt/qt59/bin:${PATH}
|
||||
qmake_conf="$qmake_conf PKG_CONFIG_PATH=/opt/qt59/lib/pkgconfig:$PKG_CONFIG_PATH"
|
||||
cmake_conf="$cmake_conf PKG_CONFIG_PATH=/opt/qt59/lib/pkgconfig:$PKG_CONFIG_PATH"
|
||||
fi
|
||||
- |
|
||||
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
|
||||
CXXFLAGS="$CXXFLAGS -Wno-unused-local-typedefs"
|
||||
|
||||
openssl_root_path="/usr/local/opt/openssl"
|
||||
qmake_conf="$qmake_conf PKG_CONFIG_PATH=$openssl_root_path/lib/pkgconfig:$PKG_CONFIG_PATH"
|
||||
cmake_conf="$cmake_conf -DOPENSSL_ROOT_DIR=$openssl_root_path"
|
||||
fi
|
||||
- |
|
||||
if [ "$gui" = "false" ]; then
|
||||
qmake_conf="$qmake_conf --disable-gui"
|
||||
cmake_conf="$cmake_conf -DCMAKE_DISABLE_FIND_PACKAGE_Qt5Widgets=ON"
|
||||
fi
|
||||
|
||||
# print settings
|
||||
- echo $libt_branch
|
||||
- echo $gui
|
||||
- echo $build_system
|
||||
- echo $qmake_conf
|
||||
- echo $cmake_conf
|
||||
|
||||
install:
|
||||
- |
|
||||
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
|
||||
# dependencies
|
||||
PATH="/usr/local/opt/ccache/libexec:$PATH"
|
||||
|
||||
brew update > /dev/null
|
||||
brew install ccache colormake boost openssl qt zlib
|
||||
brew link --force qt zlib
|
||||
|
||||
if [ "$build_system" = "cmake" ]; then
|
||||
sudo ln -s /usr/local/opt/qt/mkspecs /usr/local/mkspecs
|
||||
sudo ln -s /usr/local/opt/qt/plugins /usr/local/plugins
|
||||
fi
|
||||
fi
|
||||
- |
|
||||
if [ "$TRAVIS_BRANCH" != "$coverity_branch" ]; then
|
||||
export use_ccache=true
|
||||
ccache -M 512M
|
||||
ccache -V && ccache --show-stats && ccache --zero-stats
|
||||
fi
|
||||
- |
|
||||
if [ "$libt_branch" = "RC_1_2" ] && [ "$TRAVIS_OS_NAME" = "linux" ]; then
|
||||
wget https://builds.shiki.hu/travis/deb/version
|
||||
if ! cmp --quiet "version" "$HOME/travis/deb/version" ; then
|
||||
echo "Cached files are different from server. Downloading new ones."
|
||||
# First delete old files
|
||||
rm -r "$HOME/travis/deb"
|
||||
mkdir "$HOME/travis/deb"
|
||||
cp "version" $HOME/travis/deb
|
||||
cd "$HOME/travis/deb"
|
||||
wget https://builds.shiki.hu/travis/deb/libtorrent-rasterbar-dev_1.2.x_amd64.deb
|
||||
wget https://builds.shiki.hu/travis/deb/libtorrent-rasterbar10_1.2.x_amd64.deb
|
||||
fi
|
||||
|
||||
sudo dpkg -i "$HOME/travis/deb/libtorrent-rasterbar-dev_1.2.x_amd64.deb" "$HOME/travis/deb/libtorrent-rasterbar10_1.2.x_amd64.deb"
|
||||
fi
|
||||
- |
|
||||
if [ "$libt_branch" = "RC_1_1" ] && [ "$TRAVIS_OS_NAME" = "osx" ]; then
|
||||
wget https://builds.shiki.hu/travis/brew/1_1/version
|
||||
if ! cmp --quiet "version" "$HOME/travis/brew/1_1/version" ; then
|
||||
echo "Cached files are different from server. Downloading new ones."
|
||||
# First delete old files
|
||||
rm -r "$HOME/travis/brew/1_1"
|
||||
mkdir "$HOME/travis/brew/1_1"
|
||||
cp "version" $HOME/travis/brew/1_1
|
||||
cd "$HOME/travis/brew/1_1"
|
||||
wget https://builds.shiki.hu/travis/brew/1_1/libtorrent-rasterbar.rb
|
||||
wget https://builds.shiki.hu/travis/brew/1_1/bd36a4b440aa138a88e375c1a3b672f1a1bc6606e7866fc3415b6b98fa49e771--libtorrent-rasterbar-1.1.13.high_sierra.bottle.tar.gz
|
||||
fi
|
||||
# Copy custom libtorrent bottle to homebrew's download cache so it can find and install it
|
||||
# Also install our custom libtorrent formula by passing the local path to it
|
||||
# These 2 files are restored from Travis' cache.
|
||||
cp "$HOME/travis/brew/1_1/bd36a4b440aa138a88e375c1a3b672f1a1bc6606e7866fc3415b6b98fa49e771--libtorrent-rasterbar-1.1.13.high_sierra.bottle.tar.gz" "$(brew --cache)/downloads"
|
||||
brew uninstall libtorrent-rasterbar
|
||||
brew install "$HOME/travis/brew/1_1/libtorrent-rasterbar.rb"
|
||||
|
||||
# NOTE about the bottle name
|
||||
# The part before the "--" characters is a sha256 hash of the string
|
||||
# of the URL homebrew itself would use to download the bottle.
|
||||
# In this case the URL is the following:
|
||||
# http://127.0.0.1/libtorrent-rasterbar-1.1.13.high_sierra.bottle.tar.gz
|
||||
fi
|
||||
- |
|
||||
if [ "$libt_branch" = "RC_1_2" ] && [ "$TRAVIS_OS_NAME" = "osx" ]; then
|
||||
wget https://builds.shiki.hu/travis/brew/version
|
||||
if ! cmp --quiet "version" "$HOME/travis/brew/version" ; then
|
||||
echo "Cached files are different from server. Downloading new ones."
|
||||
# First delete old files
|
||||
rm -r "$HOME/travis/brew"
|
||||
mkdir "$HOME/travis/brew"
|
||||
cp "version" $HOME/travis/brew
|
||||
cd "$HOME/travis/brew"
|
||||
wget https://builds.shiki.hu/travis/brew/libtorrent-rasterbar.rb
|
||||
wget https://builds.shiki.hu/travis/brew/6e4eb13f70df35e8fc7ff41883fef3e5c7b535dd55c78cd2ce1eae3fb4288e21--libtorrent-rasterbar-1.2.0.high_sierra.bottle.tar.gz
|
||||
fi
|
||||
# Copy custom libtorrent bottle to homebrew's download cache so it can find and install it
|
||||
# Also install our custom libtorrent formula by passing the local path to it
|
||||
# These 2 files are restored from Travis' cache.
|
||||
cp "$HOME/travis/brew/6e4eb13f70df35e8fc7ff41883fef3e5c7b535dd55c78cd2ce1eae3fb4288e21--libtorrent-rasterbar-1.2.0.high_sierra.bottle.tar.gz" "$(brew --cache)/downloads"
|
||||
brew uninstall libtorrent-rasterbar
|
||||
brew install "$HOME/travis/brew/libtorrent-rasterbar.rb"
|
||||
|
||||
# NOTE about the bottle name
|
||||
# The part before the "--" characters is a sha256 hash of the string
|
||||
# of the URL homebrew itself would use to download the bottle.
|
||||
# In this case the URL is the following:
|
||||
# http://127.0.0.1/libtorrent-rasterbar-1.2.0.high_sierra.bottle.tar.gz
|
||||
fi
|
||||
|
||||
script:
|
||||
- if [ "$TRAVIS_BRANCH" = "$coverity_branch" ]; then exit ; fi # skip usual build when running coverity scan
|
||||
- |
|
||||
cd "$TRAVIS_BUILD_DIR"
|
||||
if [ "$build_system" = "qmake" ]; then
|
||||
# scan only as lupdate is prone to hang
|
||||
lupdate -extensions c,cpp,h,hpp,ui ./
|
||||
./bootstrap.sh
|
||||
./configure $qmake_conf CXXFLAGS="$CXXFLAGS"
|
||||
else
|
||||
mkdir build && cd build
|
||||
cmake $cmake_conf ../
|
||||
fi
|
||||
- make && make install
|
||||
|
||||
after_success:
|
||||
- if [ "$gui" = "true" ]; then qbt_exe="qbittorrent" ; else qbt_exe="qbittorrent-nox" ; fi
|
||||
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then cd "$qbt_path/bin" ; fi
|
||||
- |
|
||||
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
|
||||
if [ "$build_system" = "qmake" ]; then
|
||||
macdeployqt "$TRAVIS_BUILD_DIR/src/$qbt_exe.app"
|
||||
cd "$TRAVIS_BUILD_DIR/src/$qbt_exe.app/Contents/MacOS"
|
||||
else
|
||||
cd "$qbt_path/$qbt_exe.app/Contents/MacOS"
|
||||
fi
|
||||
fi
|
||||
- ./$qbt_exe --version
|
||||
|
||||
after_script:
|
||||
- if [ "$use_ccache" = true ]; then ccache --show-stats ; fi
|
22
AUTHORS
22
AUTHORS
@@ -17,23 +17,19 @@ Contributors:
|
||||
* Nick Tiskov <daymansmail@gmail.com>
|
||||
|
||||
Code from other projects:
|
||||
* files src/app/qtlocalpeer/*
|
||||
* files src/qtsingleapplication/* src/lineedit/*
|
||||
copyright: Nokia Corporation
|
||||
license: mixed
|
||||
license: LGPL
|
||||
|
||||
* files src/gui/lineedit.*
|
||||
copyright: Trolltech ASA <info@trolltech.com>
|
||||
license: custom
|
||||
* files src/ico.cpp src/ico.h
|
||||
copyright: Malte Starostik <malte@kde.org>
|
||||
license: LGPL
|
||||
|
||||
* files src/search_engine/socks.py
|
||||
copyright: Dan Haim <negativeiq@users.sourceforge.net>
|
||||
license: BSD
|
||||
|
||||
* file src/app/stacktrace.h
|
||||
copyright: Timo Bingmann from http://idlebox.net/
|
||||
license: WTFPL v2.0
|
||||
|
||||
* file src/app/stacktrace_win.h
|
||||
* file src/stacktrace_win.h
|
||||
copyright: Quassel Project
|
||||
license: GPLv2/3
|
||||
|
||||
@@ -66,7 +62,7 @@ Images Authors:
|
||||
copyright: Mateusz Tobola <tobejodok@qbittorrent.org>
|
||||
license: GPLv2
|
||||
|
||||
* file: src/icons/tabs.gif
|
||||
* file: src/icons/skin/tabs.gif
|
||||
copyright: Greg Houston <gregory.houston@gmail.com>
|
||||
license: MIT
|
||||
|
||||
@@ -91,7 +87,7 @@ Images Authors:
|
||||
|
||||
* file: src/icons/oxygen/checked.png
|
||||
copyright: Victor Buinsky <allok.victor@gmail.com>
|
||||
|
||||
|
||||
* file: src/icons/skin/ratio.png
|
||||
copyright: Fatcow Web Hosting
|
||||
license: Creative Commons Attribution 3.0 License
|
||||
@@ -123,7 +119,7 @@ Translations authors:
|
||||
- German: Niels Hoffmann (zentralmaschine@users.sourceforge.net)
|
||||
- Greek: Tsvetan Bankov (emerge_life@users.sourceforge.net), Stephanos Antaris (santaris@csd.auth.gr), sledgehammer999(hammered999@gmail.com) and Γιάννης Ανθυμίδης Evropi(Transifex)
|
||||
- Hebrew: David Deutsch (d.deffo@gmail.com)
|
||||
- Hungarian: Majoros Péter
|
||||
- Hungarian: Majoros Péter (majoros.j.p@t-online.hu)
|
||||
- Italian: bovirus (bovirus@live.it) and Matteo Sechi (bu17714@gmail.com)
|
||||
- Japanese: Masato Hashimoto (cabezon.hashimoto@gmail.com)
|
||||
- Korean: Jin Woo Sin (jin828sin@users.sourceforge.net)
|
||||
|
108
CMakeLists.txt
108
CMakeLists.txt
@@ -1,64 +1,60 @@
|
||||
cmake_minimum_required(VERSION 3.16 FATAL_ERROR) # Policies <= CMP0097 default to NEW
|
||||
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules)
|
||||
message(AUTHOR_WARNING "If the build fails, please try the autotools/qmake method.")
|
||||
|
||||
project(qBittorrent
|
||||
DESCRIPTION "The qBittorrent BitTorrent client"
|
||||
HOMEPAGE_URL "https://www.qbittorrent.org/"
|
||||
LANGUAGES CXX
|
||||
)
|
||||
|
||||
# use CONFIG mode first in find_package
|
||||
set(CMAKE_FIND_PACKAGE_PREFER_CONFIG ON)
|
||||
# version requirements - older vesions may work, but you are on your own
|
||||
set(minBoostVersion 1.65)
|
||||
set(minQtVersion 5.11)
|
||||
set(minOpenSSLVersion 1.1.1)
|
||||
set(minLibtorrentVersion 1.2.12)
|
||||
set(minZlibVersion 1.2.11)
|
||||
|
||||
# features (some are platform-specific)
|
||||
include(CheckCXXSourceCompiles) # TODO: migrate to CheckSourceCompiles in CMake >= 3.19
|
||||
include(FeatureSummary)
|
||||
include(FeatureOptionsSetup)
|
||||
feature_option(STACKTRACE "Enable stacktraces" ON)
|
||||
feature_option(GUI "Build GUI application" ON)
|
||||
feature_option(WEBUI "Enables built-in HTTP server for headless use" ON)
|
||||
feature_option(VERBOSE_CONFIGURE "Show information about PACKAGES_FOUND and PACKAGES_NOT_FOUND in the configure output (only useful for debugging the CMake build scripts)" OFF)
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
feature_option_dependent(DBUS
|
||||
"Enables support for notifications and power-management features on Linux via D-Bus"
|
||||
ON "GUI" OFF
|
||||
)
|
||||
feature_option_dependent(SYSTEMD
|
||||
"Install systemd service file to a directory manually overridable with Systemd_SERVICES_INSTALL_DIR"
|
||||
OFF "NOT GUI" OFF
|
||||
)
|
||||
if (STACKTRACE)
|
||||
check_cxx_source_compiles(
|
||||
"#include <execinfo.h>
|
||||
int main(){return 0;}"
|
||||
QBITTORRENT_HAS_EXECINFO_H
|
||||
)
|
||||
if (NOT QBITTORRENT_HAS_EXECINFO_H)
|
||||
message(FATAL_ERROR "execinfo.h header file not found.\n"
|
||||
"Please either disable the STACKTRACE feature or use a libc that has this header file, such as glibc (GNU libc)."
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
elseif (MSVC)
|
||||
feature_option(MSVC_RUNTIME_DYNAMIC "Use MSVC dynamic runtime library (-MD) instead of static (-MT)" ON)
|
||||
if(POLICY CMP0074)
|
||||
cmake_policy(SET CMP0074 NEW)
|
||||
endif()
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules)
|
||||
include(FunctionReadVersion)
|
||||
|
||||
read_version("${CMAKE_CURRENT_SOURCE_DIR}/version.pri" VER_MAJOR VER_MINOR VER_BUGFIX VER_BUILD VER_STATUS)
|
||||
# message(STATUS "Project version is: ${VER_MAJOR}.${VER_MINOR}.${VER_BUGFIX}.${VER_BUILD} (${VER_STATUS})")
|
||||
|
||||
project(qBittorrent VERSION ${VER_MAJOR}.${VER_MINOR}.${VER_BUGFIX}.${VER_BUILD})
|
||||
|
||||
set(PROJECT_VERSION "${VER_MAJOR}.${VER_MINOR}.${VER_BUGFIX}")
|
||||
|
||||
if (NOT VER_BUILD EQUAL 0)
|
||||
set(PROJECT_VERSION "${PROJECT_VERSION}.${VER_BUILD}")
|
||||
endif()
|
||||
|
||||
set(PROJECT_VERSION "${PROJECT_VERSION}${VER_STATUS}")
|
||||
|
||||
add_definitions(-DQBT_VERSION_MAJOR=${VER_MAJOR})
|
||||
add_definitions(-DQBT_VERSION_MINOR=${VER_MINOR})
|
||||
add_definitions(-DQBT_VERSION_BUGFIX=${VER_BUGFIX})
|
||||
add_definitions(-DQBT_VERSION_BUILD=${VER_BUILD})
|
||||
|
||||
add_definitions(-DQBT_VERSION="v${PROJECT_VERSION}")
|
||||
add_definitions(-DQBT_VERSION_2="${PROJECT_VERSION}")
|
||||
|
||||
include(GNUInstallDirs)
|
||||
include(FeatureSummary)
|
||||
|
||||
# version requirements
|
||||
set(requiredBoostVersion 1.40)
|
||||
set(requiredQtVersion 5.9.0)
|
||||
set(requiredOpensslVersion 1.0)
|
||||
set(requiredLibtorrentVersion 1.1.10)
|
||||
|
||||
if(WIN32)
|
||||
include(winconf)
|
||||
endif(WIN32)
|
||||
|
||||
|
||||
# we need options here, at the top level, because they are used not only in "src" subdir, but in the "dist" dir too
|
||||
include(CompileFeature)
|
||||
|
||||
optional_compile_definitions(COUNTRIES_RESOLUTION FEATURE DESCRIPTION "Enable resolving peers IP addresses to countries"
|
||||
DEFAULT ON DISABLED DISABLE_COUNTRIES_RESOLUTION)
|
||||
optional_compile_definitions(STACKTRACE FEATURE DESCRIPTION "Enable stacktraces"
|
||||
DEFAULT ON ENABLED STACKTRACE)
|
||||
optional_compile_definitions(WEBUI FEATURE DESCRIPTION "Enables built-in HTTP server for headless use"
|
||||
DEFAULT ON DISABLED DISABLE_WEBUI)
|
||||
|
||||
add_subdirectory(src)
|
||||
add_subdirectory(dist)
|
||||
|
||||
if (VERBOSE_CONFIGURE)
|
||||
feature_summary(WHAT ALL)
|
||||
else()
|
||||
feature_summary(WHAT ENABLED_FEATURES DISABLED_FEATURES)
|
||||
endif()
|
||||
|
||||
# Generate version header
|
||||
configure_file("src/base/version.h.in" "${CMAKE_CURRENT_SOURCE_DIR}/src/base/version.h" @ONLY)
|
||||
feature_summary(DESCRIPTION "\nConfiguration results:" WHAT ALL)
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -138,7 +138,7 @@ These are unstable/unsupported platforms, and in all likelihood, whatever the is
|
||||
* **For performance-related issues**, include as much profiling data as you can (resource usage graphs, etc).
|
||||
|
||||
* Paste the **qBittorrent log** (or put the contents of the log in a gist and provide a link to the gist). The log can be viewed in the GUI (View -> Log -> tick all boxes). If you can't do that, the file is at:
|
||||
- Linux: `~/.local/share/qBittorrent/logs/qBittorrent.log`
|
||||
- Linux: `~/.local/share/data/qBittorrent/logs/qBittorrent.log`
|
||||
- Windows: `%LocalAppData%\qBittorrent\logs`
|
||||
- macOS: `~/Library/Application Support/qBittorrent/qBittorrent.log`
|
||||
|
||||
|
7
COPYING
7
COPYING
@@ -1,6 +1,5 @@
|
||||
qBittorrent is licensed under the GNU General Public License either version 2,
|
||||
or (at your option) any later version with the addition of the following
|
||||
special exception:
|
||||
qBittorrent is licensed under the GNU General Public License version 2 with the
|
||||
addition of the following special exception:
|
||||
|
||||
In addition, as a special exception, the copyright holders give permission to
|
||||
link this program with the OpenSSL project's "OpenSSL" library (or with
|
||||
@@ -11,8 +10,6 @@ modify file(s), you may extend this exception to your version of the file(s),
|
||||
but you are not obligated to do so. If you do not wish to do so, delete this
|
||||
exception statement from your version.
|
||||
|
||||
See also the AUTHORS file
|
||||
|
||||
----------
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
|
18
INSTALL
18
INSTALL
@@ -3,27 +3,23 @@ qBittorrent - A BitTorrent client in C++ / Qt
|
||||
|
||||
1) Install these dependencies:
|
||||
|
||||
- Boost >= 1.65
|
||||
- Boost >= 1.40
|
||||
|
||||
- libtorrent-rasterbar >= 1.2.12 (by Arvid Norberg)
|
||||
- libtorrent-rasterbar >= 1.1.10 (by Arvid Norberg)
|
||||
* https://www.libtorrent.org/
|
||||
* Be careful: another library (the one used by rTorrent) uses a similar name
|
||||
|
||||
- OpenSSL >= 1.1.1
|
||||
- OpenSSL >= 1.0
|
||||
|
||||
- Qt >= 5.12
|
||||
- Qt >= 5.9.0
|
||||
|
||||
- zlib >= 1.2.11
|
||||
- zlib >= 1.2.5.2
|
||||
|
||||
- pkg-config (compile-time only on *nix systems)
|
||||
- pkg-config (compile-time only)
|
||||
|
||||
- Python >= 3.5.0 (optional, runtime only)
|
||||
- Python >= 3.3.0 (optional, runtime only)
|
||||
* Required by the internal search engine
|
||||
|
||||
Dependency version numbers are bumped every once in a while to keep the range of properly tested configurations manageable, even if not strictly required to build.
|
||||
You may be able to build with older versions of (some of) the dependencies other than the minimum versions specified in the build scripts, but support for such builds is not provided - you are on your own.
|
||||
Please ensure you are building with an officially supported configuration when reporting bugs.
|
||||
|
||||
2a) Compile and install qBittorrent with Qt graphical interface
|
||||
|
||||
$ ./configure
|
||||
|
@@ -1,8 +1,8 @@
|
||||
qBittorrent - A BitTorrent client in Qt
|
||||
------------------------------------------
|
||||
|
||||
[](https://travis-ci.org/qbittorrent/qBittorrent)
|
||||
[](https://ci.appveyor.com/project/qbittorrent/qBittorrent)
|
||||
[](https://github.com/qbittorrent/qBittorrent/actions)
|
||||
[](https://scan.coverity.com/projects/5494)
|
||||
********************************
|
||||
### Description:
|
||||
|
@@ -1,19 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# get version numbers
|
||||
versionSrc="src/base/version.h.in"
|
||||
versionMajor="$(grep -Po '(?<=QBT_VERSION_MAJOR )\d+' "$versionSrc")"
|
||||
versionMinor="$(grep -Po '(?<=QBT_VERSION_MINOR )\d+' "$versionSrc")"
|
||||
versionBugfix="$(grep -Po '(?<=QBT_VERSION_BUGFIX )\d+' "$versionSrc")"
|
||||
versionBuild="$(grep -Po '(?<=QBT_VERSION_BUILD )\d+' "$versionSrc")"
|
||||
versionStatus="$(grep -Po '(?<=QBT_VERSION_STATUS ")\w+' "$versionSrc")"
|
||||
|
||||
if [ "$versionBuild" != "0" ]; then
|
||||
projectVersion="$versionMajor.$versionMinor.$versionBugfix.$versionBuild$versionStatus"
|
||||
else
|
||||
projectVersion="$versionMajor.$versionMinor.$versionBugfix$versionStatus"
|
||||
fi
|
||||
|
||||
# pack archives
|
||||
git archive --format=tar --prefix="qbittorrent-$projectVersion/" HEAD | gzip -9 > "qbittorrent-$projectVersion.tar.gz"
|
||||
git archive --format=tar --prefix="qbittorrent-$projectVersion/" HEAD | xz -9 > "qbittorrent-$projectVersion.tar.xz"
|
22
cmake/Modules/CompileFeature.cmake
Normal file
22
cmake/Modules/CompileFeature.cmake
Normal file
@@ -0,0 +1,22 @@
|
||||
# Helper function for coupling add_feature_info(), option(), and add_definitions()
|
||||
|
||||
function(optional_compile_definitions _name)
|
||||
set(options FEATURE)
|
||||
set(oneValueArgs DESCRIPTION DEFAULT)
|
||||
set(multiValueArgs ENABLED DISABLED)
|
||||
cmake_parse_arguments(OCD "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
||||
option(${_name} "${OCD_DESCRIPTION}" ${OCD_DEFAULT})
|
||||
if (${${_name}})
|
||||
set_property(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" APPEND PROPERTY COMPILE_DEFINITIONS ${OCD_ENABLED})
|
||||
else()
|
||||
set_property(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" APPEND PROPERTY COMPILE_DEFINITIONS ${OCD_DISABLED})
|
||||
endif()
|
||||
if(${OCD_FEATURE})
|
||||
add_feature_info(${_name} ${_name} "${OCD_DESCRIPTION}")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
macro(feature_option _name _description _default)
|
||||
option(${_name} "${_description}" ${_default})
|
||||
add_feature_info(${_name} ${_name} "${_description}")
|
||||
endmacro()
|
355
cmake/Modules/DeployQt5.cmake
Normal file
355
cmake/Modules/DeployQt5.cmake
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,14 +0,0 @@
|
||||
# Helper functions for coupling add_feature_info() or CMAKE_DEPENDENT_OPTION() and option()
|
||||
|
||||
function(feature_option _name _description _default)
|
||||
string(CONCAT _desc "${_description} (default: ${_default})")
|
||||
option("${_name}" "${_desc}" "${_default}")
|
||||
add_feature_info("${_name}" "${_name}" "${_desc}")
|
||||
endfunction()
|
||||
|
||||
include(CMakeDependentOption)
|
||||
function(feature_option_dependent _name _description _default_opt _dependency _default_dep_not_sat)
|
||||
string(CONCAT _desc "${_description} (default: ${_default_opt}; depends on condition: ${_dependency})")
|
||||
CMAKE_DEPENDENT_OPTION("${_name}" "${_desc}" "${_default_opt}" "${_dependency}" "${_default_dep_not_sat}")
|
||||
add_feature_info("${_name}" "${_name}" "${_desc}")
|
||||
endfunction()
|
129
cmake/Modules/FindLibtorrentRasterbar.cmake
Normal file
129
cmake/Modules/FindLibtorrentRasterbar.cmake
Normal file
@@ -0,0 +1,129 @@
|
||||
# - Try to find libtorrent-rasterbar
|
||||
#
|
||||
# If not using pkg-config, you can pre-set LibtorrentRasterbar_CUSTOM_DEFINITIONS
|
||||
# for definitions unrelated to Boost's separate compilation (which are already
|
||||
# decided by the LibtorrentRasterbar_USE_STATIC_LIBS variable).
|
||||
#
|
||||
# Once done this will define
|
||||
# LibtorrentRasterbar_FOUND - System has libtorrent-rasterbar
|
||||
# LibtorrentRasterbar_INCLUDE_DIRS - The libtorrent-rasterbar include directories
|
||||
# LibtorrentRasterbar_LIBRARIES - The libraries needed to use libtorrent-rasterbar
|
||||
# LibtorrentRasterbar_DEFINITIONS - Compiler switches required for using libtorrent-rasterbar
|
||||
# LibtorrentRasterbar_OPENSSL_ENABLED - libtorrent-rasterbar uses and links against OpenSSL
|
||||
|
||||
find_package(Threads REQUIRED)
|
||||
find_package(PkgConfig QUIET)
|
||||
|
||||
macro(_detect_boost_components _outComponets librariesList)
|
||||
string(REGEX MATCHALL "boost_[a-z_]+[-a-z]*" _boost_libraries "${librariesList}")
|
||||
string(REGEX REPLACE "boost_([a-z_]+)[-a-z]*" "\\1" ${_outComponets} "${_boost_libraries}")
|
||||
endmacro()
|
||||
|
||||
if(PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(PC_LIBTORRENT_RASTERBAR QUIET libtorrent-rasterbar)
|
||||
endif()
|
||||
|
||||
if(LibtorrentRasterbar_USE_STATIC_LIBS)
|
||||
set(LibtorrentRasterbar_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_STATIC_LIBRARY_SUFFIX})
|
||||
endif()
|
||||
|
||||
if(PC_LIBTORRENT_RASTERBAR_FOUND)
|
||||
set(LibtorrentRasterbar_DEFINITIONS ${PC_LIBTORRENT_RASTERBAR_CFLAGS})
|
||||
else()
|
||||
if(LibtorrentRasterbar_CUSTOM_DEFINITIONS)
|
||||
set(LibtorrentRasterbar_DEFINITIONS ${LibtorrentRasterbar_CUSTOM_DEFINITIONS})
|
||||
else()
|
||||
# Without pkg-config, we can't possibly figure out the correct build flags.
|
||||
# libtorrent is very picky about those. Let's take a set of defaults and
|
||||
# hope that they apply. If not, you the user are on your own.
|
||||
set(LibtorrentRasterbar_DEFINITIONS
|
||||
-DTORRENT_USE_LIBCRYPTO
|
||||
# TODO: remove the following define as it is not used since OpenSSL >= 1.1
|
||||
-DTORRENT_USE_OPENSSL
|
||||
-DBOOST_ASIO_ENABLE_CANCELIO
|
||||
-DUNICODE -D_UNICODE -D_FILE_OFFSET_BITS=64)
|
||||
endif()
|
||||
|
||||
if(NOT LibtorrentRasterbar_USE_STATIC_LIBS)
|
||||
list(APPEND LibtorrentRasterbar_DEFINITIONS
|
||||
-DTORRENT_LINKING_SHARED
|
||||
-DBOOST_SYSTEM_DYN_LINK)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
message(STATUS "libtorrent definitions: ${LibtorrentRasterbar_DEFINITIONS}")
|
||||
|
||||
find_path(LibtorrentRasterbar_INCLUDE_DIR libtorrent
|
||||
HINTS ${PC_LIBTORRENT_RASTERBAR_INCLUDEDIR} ${PC_LIBTORRENT_RASTERBAR_INCLUDE_DIRS}
|
||||
PATH_SUFFIXES libtorrent-rasterbar)
|
||||
|
||||
find_library(LibtorrentRasterbar_LIBRARY NAMES torrent-rasterbar libtorrent
|
||||
HINTS ${PC_LIBTORRENT_RASTERBAR_LIBDIR} ${PC_LIBTORRENT_RASTERBAR_LIBRARY_DIRS})
|
||||
|
||||
if(LibtorrentRasterbar_USE_STATIC_LIBS)
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ${LibtorrentRasterbar_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
endif()
|
||||
|
||||
set(LibtorrentRasterbar_LIBRARIES ${LibtorrentRasterbar_LIBRARY} ${CMAKE_THREAD_LIBS_INIT})
|
||||
set(LibtorrentRasterbar_INCLUDE_DIRS ${LibtorrentRasterbar_INCLUDE_DIR})
|
||||
|
||||
# Without pkg-config, we can't possibly figure out the correct boost dependencies
|
||||
if (LibtorrentRasterbar_CUSTOM_BOOST_DEPENDENCIES)
|
||||
set(_boost_components "${LibtorrentRasterbar_CUSTOM_BOOST_DEPENDENCIES}")
|
||||
else(LibtorrentRasterbar_CUSTOM_BOOST_DEPENDENCIES)
|
||||
if(PC_LIBTORRENT_RASTERBAR_FOUND)
|
||||
_detect_boost_components(_boost_components "${PC_LIBTORRENT_RASTERBAR_LIBRARIES}")
|
||||
else()
|
||||
# all possible boost dependencies
|
||||
set(_boost_components
|
||||
date_time
|
||||
system
|
||||
chrono
|
||||
random
|
||||
thread
|
||||
)
|
||||
endif()
|
||||
endif(LibtorrentRasterbar_CUSTOM_BOOST_DEPENDENCIES)
|
||||
|
||||
list(SORT _boost_components)
|
||||
message(STATUS "Libtorrent Boost dependencies: ${_boost_components}")
|
||||
find_package(Boost REQUIRED COMPONENTS ${_boost_components})
|
||||
set(LibtorrentRasterbar_LIBRARIES ${LibtorrentRasterbar_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
|
||||
foreach(_boost_cmpnt IN LISTS _boost_components)
|
||||
list(APPEND LibtorrentRasterbar_LIBRARIES "Boost::${_boost_cmpnt}")
|
||||
endforeach(_boost_cmpnt)
|
||||
|
||||
set(LibtorrentRasterbar_INCLUDE_DIRS ${LibtorrentRasterbar_INCLUDE_DIRS})
|
||||
|
||||
list(FIND LibtorrentRasterbar_DEFINITIONS -DTORRENT_USE_OPENSSL LibtorrentRasterbar_ENCRYPTION_INDEX)
|
||||
if(LibtorrentRasterbar_ENCRYPTION_INDEX GREATER -1)
|
||||
find_package(OpenSSL REQUIRED)
|
||||
set(LibtorrentRasterbar_LIBRARIES ${LibtorrentRasterbar_LIBRARIES} OpenSSL::SSL OpenSSL::Crypto)
|
||||
list(APPEND LibtorrentRasterbar_INCLUDE_DIRS "${OPENSSL_INCLUDE_DIR}")
|
||||
set(LibtorrentRasterbar_OPENSSL_ENABLED ON)
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
# handle the QUIETLY and REQUIRED arguments and set LibtorrentRasterbar_FOUND to TRUE
|
||||
# if all listed variables are TRUE
|
||||
find_package_handle_standard_args(LibtorrentRasterbar DEFAULT_MSG
|
||||
LibtorrentRasterbar_LIBRARY
|
||||
LibtorrentRasterbar_INCLUDE_DIR)
|
||||
|
||||
mark_as_advanced(LibtorrentRasterbar_INCLUDE_DIR LibtorrentRasterbar_LIBRARY
|
||||
LibtorrentRasterbar_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES
|
||||
LibtorrentRasterbar_ENCRYPTION_INDEX)
|
||||
|
||||
if (LibtorrentRasterbar_FOUND AND NOT TARGET LibtorrentRasterbar::torrent-rasterbar)
|
||||
add_library(LibtorrentRasterbar::torrent-rasterbar UNKNOWN IMPORTED)
|
||||
|
||||
set_target_properties(LibtorrentRasterbar::torrent-rasterbar PROPERTIES
|
||||
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
|
||||
IMPORTED_LOCATION "${LibtorrentRasterbar_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${LibtorrentRasterbar_INCLUDE_DIRS}"
|
||||
INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${LibtorrentRasterbar_INCLUDE_DIRS}"
|
||||
INTERFACE_LINK_LIBRARIES "${LibtorrentRasterbar_LIBRARIES}"
|
||||
INTERFACE_COMPILE_OPTIONS "${LibtorrentRasterbar_DEFINITIONS}"
|
||||
)
|
||||
endif()
|
@@ -8,7 +8,7 @@ find_package(PkgConfig QUIET REQUIRED)
|
||||
|
||||
if (NOT SYSTEMD_FOUND)
|
||||
pkg_check_modules(SYSTEMD "systemd")
|
||||
endif()
|
||||
endif(NOT SYSTEMD_FOUND)
|
||||
|
||||
if (SYSTEMD_FOUND AND "${SYSTEMD_SERVICES_INSTALL_DIR}" STREQUAL "")
|
||||
execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE}
|
||||
@@ -23,4 +23,4 @@ endif()
|
||||
|
||||
if (SYSTEMD_FOUND)
|
||||
message(STATUS "systemd services install dir: ${SYSTEMD_SERVICES_INSTALL_DIR}")
|
||||
endif()
|
||||
endif(SYSTEMD_FOUND)
|
||||
|
28
cmake/Modules/FunctionReadVersion.cmake
Normal file
28
cmake/Modules/FunctionReadVersion.cmake
Normal file
@@ -0,0 +1,28 @@
|
||||
# function for parsing version variables that are set in version.pri file
|
||||
# the version identifiers there are defined as follows:
|
||||
# VER_MAJOR = 3
|
||||
# VER_MINOR = 4
|
||||
# VER_BUGFIX = 0
|
||||
# VER_BUILD = 0
|
||||
# VER_STATUS = alpha
|
||||
|
||||
function(read_version priFile outMajor outMinor outBugfix outBuild outStatus)
|
||||
file(STRINGS ${priFile} _priFileContents REGEX "^VER_.+")
|
||||
# message(STATUS "version.pri version contents: ${_priFileContents}")
|
||||
# the _priFileContents variable contains something like the following:
|
||||
# VER_MAJOR = 3;VER_MINOR = 4;VER_BUGFIX = 0;VER_BUILD = 0;VER_STATUS = alpha # Should be empty for stable releases!
|
||||
set(_regex "VER_MAJOR += +([0-9]+);VER_MINOR += +([0-9]+);VER_BUGFIX += +([0-9]+);VER_BUILD += +([0-9]+);VER_STATUS += +([0-9A-Za-z]+)?")
|
||||
# note quotes around _regex, they are needed because the variable contains semicolons
|
||||
string(REGEX MATCH "${_regex}" _tmp "${_priFileContents}")
|
||||
if (NOT _tmp)
|
||||
message(FATAL_ERROR "Could not detect project version number from ${priFile}")
|
||||
endif()
|
||||
|
||||
# message(STATUS "Matched version string: ${_tmp}")
|
||||
|
||||
set(${outMajor} ${CMAKE_MATCH_1} PARENT_SCOPE)
|
||||
set(${outMinor} ${CMAKE_MATCH_2} PARENT_SCOPE)
|
||||
set(${outBugfix} ${CMAKE_MATCH_3} PARENT_SCOPE)
|
||||
set(${outBuild} ${CMAKE_MATCH_4} PARENT_SCOPE)
|
||||
set(${outStatus} ${CMAKE_MATCH_5} PARENT_SCOPE)
|
||||
endfunction()
|
36
cmake/Modules/MacroConfigureMSVCRuntime.cmake
Normal file
36
cmake/Modules/MacroConfigureMSVCRuntime.cmake
Normal file
@@ -0,0 +1,36 @@
|
||||
macro(configure_msvc_runtime)
|
||||
# Default to statically-linked runtime.
|
||||
if("${MSVC_RUNTIME}" STREQUAL "")
|
||||
set(MSVC_RUNTIME "static")
|
||||
endif()
|
||||
# Set compiler options.
|
||||
set(variables
|
||||
CMAKE_C_FLAGS_DEBUG
|
||||
CMAKE_C_FLAGS_MINSIZEREL
|
||||
CMAKE_C_FLAGS_RELEASE
|
||||
CMAKE_C_FLAGS_RELWITHDEBINFO
|
||||
CMAKE_CXX_FLAGS_DEBUG
|
||||
CMAKE_CXX_FLAGS_MINSIZEREL
|
||||
CMAKE_CXX_FLAGS_RELEASE
|
||||
CMAKE_CXX_FLAGS_RELWITHDEBINFO
|
||||
)
|
||||
if(${MSVC_RUNTIME} STREQUAL "static")
|
||||
message(STATUS
|
||||
"MSVC -> forcing use of statically-linked runtime."
|
||||
)
|
||||
foreach(variable ${variables})
|
||||
if(${variable} MATCHES "/MD")
|
||||
string(REGEX REPLACE "/MD" "/MT" ${variable} "${${variable}}")
|
||||
endif()
|
||||
endforeach()
|
||||
else()
|
||||
message(STATUS
|
||||
"MSVC -> forcing use of dynamically-linked runtime."
|
||||
)
|
||||
foreach(variable ${variables})
|
||||
if(${variable} MATCHES "/MT")
|
||||
string(REGEX REPLACE "/MT" "/MD" ${variable} "${${variable}}")
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
endmacro()
|
28
cmake/Modules/MacroLinkQtComponents.cmake
Normal file
28
cmake/Modules/MacroLinkQtComponents.cmake
Normal file
@@ -0,0 +1,28 @@
|
||||
# - macro similar to target_link_libraries, which links Qt components
|
||||
# names of the components are passed in Qt4/Qt5 agnostic way (Core, DBus, Xml...)
|
||||
# and the macro links Qt4 ones if QT4_FOUND is set or Qt5 ones if not
|
||||
|
||||
macro (target_link_qt_components target)
|
||||
if (QT4_FOUND)
|
||||
foreach(_cmp ${ARGN})
|
||||
if ("${_cmp}" STREQUAL "PRIVATE" OR
|
||||
"${_cmp}" STREQUAL "PUBLIC" OR
|
||||
"${_cmp}" STREQUAL "INTERFACE")
|
||||
list(APPEND _QT_CMPNTS "${_cmp}")
|
||||
else()
|
||||
list(APPEND _QT_CMPNTS "Qt4::Qt${_cmp}")
|
||||
endif()
|
||||
endforeach()
|
||||
else (QT4_FOUND)
|
||||
foreach(_cmp ${ARGN})
|
||||
if ("${_cmp}" STREQUAL "PRIVATE" OR
|
||||
"${_cmp}" STREQUAL "PUBLIC" OR
|
||||
"${_cmp}" STREQUAL "INTERFACE")
|
||||
list(APPEND _QT_CMPNTS "${_cmp}")
|
||||
else()
|
||||
list(APPEND _QT_CMPNTS "Qt5::${_cmp}")
|
||||
endif()
|
||||
endforeach()
|
||||
endif (QT4_FOUND)
|
||||
target_link_libraries(${target} ${_QT_CMPNTS})
|
||||
endmacro()
|
@@ -1,91 +0,0 @@
|
||||
# Set common variables and create some interface-only library targets
|
||||
# that some or all other targets will link to, either directly or transitively,
|
||||
# to consume common compile options/definitions
|
||||
|
||||
macro(qbt_common_config)
|
||||
|
||||
# treat value specified by the CXX_STANDARD target property as a requirement by default
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
add_library(qbt_common_cfg INTERFACE)
|
||||
|
||||
# Full C++ 17 support is required
|
||||
# See also https://cmake.org/cmake/help/latest/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.html
|
||||
# for a breakdown of the features that CMake recognizes for each C++ standard
|
||||
target_compile_features(qbt_common_cfg INTERFACE
|
||||
cxx_std_17
|
||||
)
|
||||
|
||||
target_compile_definitions(qbt_common_cfg INTERFACE
|
||||
QT_DEPRECATED_WARNINGS
|
||||
QT_NO_CAST_TO_ASCII
|
||||
QT_NO_CAST_FROM_BYTEARRAY
|
||||
QT_USE_QSTRINGBUILDER
|
||||
QT_STRICT_ITERATORS
|
||||
$<$<NOT:$<CONFIG:Debug>>:QT_NO_DEBUG_OUTPUT>
|
||||
)
|
||||
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||
target_compile_definitions(qbt_common_cfg INTERFACE
|
||||
NTDDI_VERSION=0x06010000
|
||||
_WIN32_WINNT=0x0601
|
||||
_WIN32_IE=0x0601
|
||||
WIN32_LEAN_AND_MEAN
|
||||
NOMINMAX
|
||||
UNICODE
|
||||
_UNICODE
|
||||
)
|
||||
endif()
|
||||
|
||||
if ((CXX_COMPILER_ID STREQUAL "GNU") OR (CXX_COMPILER_ID STREQUAL "Clang") OR (CXX_COMPILER_ID STREQUAL "AppleClang"))
|
||||
target_compile_options(qbt_common_cfg INTERFACE
|
||||
-Wall
|
||||
-Wextra
|
||||
-Wcast-qual
|
||||
-Wcast-align
|
||||
-Winvalid-pch
|
||||
-Woverloaded-virtual
|
||||
-Wold-style-cast
|
||||
-Wnon-virtual-dtor
|
||||
-pedantic
|
||||
-pedantic-errors
|
||||
)
|
||||
|
||||
# Clang 11 still doesn't support -Wstrict-null-sentinel
|
||||
include(CheckCXXCompilerFlag)
|
||||
check_cxx_compiler_flag(-Wstrict-null-sentinel SNS_SUPPORT)
|
||||
if (SNS_SUPPORT)
|
||||
target_compile_options(qbt_common_cfg INTERFACE -Wstrict-null-sentinel)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if ((CXX_COMPILER_ID STREQUAL "Clang") OR (CXX_COMPILER_ID STREQUAL "AppleClang"))
|
||||
target_compile_options(qbt_common_cfg INTERFACE
|
||||
-Wno-range-loop-analysis
|
||||
)
|
||||
endif()
|
||||
|
||||
if (MINGW)
|
||||
target_link_options(qbt_common_cfg INTERFACE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:LINKER:--dynamicbase>)
|
||||
endif()
|
||||
|
||||
if (MSVC_RUNTIME_DYNAMIC)
|
||||
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
|
||||
else()
|
||||
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
||||
endif()
|
||||
|
||||
if (MSVC)
|
||||
target_compile_options(qbt_common_cfg INTERFACE
|
||||
/guard:cf
|
||||
/utf-8
|
||||
)
|
||||
target_link_options(qbt_common_cfg INTERFACE
|
||||
/guard:cf
|
||||
$<$<NOT:$<CONFIG:Debug>>:/OPT:REF /OPT:ICF>
|
||||
# suppress linking warning due to /INCREMENTAL and /OPT:ICF being both ON
|
||||
$<$<CONFIG:RelWithDebInfo>:/INCREMENTAL:NO>
|
||||
)
|
||||
endif()
|
||||
|
||||
endmacro(qbt_common_config)
|
74
cmake/Modules/MacroQbtCompilerSettings.cmake
Normal file
74
cmake/Modules/MacroQbtCompilerSettings.cmake
Normal file
@@ -0,0 +1,74 @@
|
||||
# Sets cache variable QBT_ADDITONAL_FLAGS and QBT_ADDITONAL_CXX_FLAGS to list of additional
|
||||
# compiler flags for C and C++ (QBT_ADDITONAL_FLAGS) and for C++ only (QBT_ADDITONAL_CXX_FLAGS)
|
||||
# and appends them to CMAKE_XXX_FLAGS variables.
|
||||
|
||||
# It could use add_compile_options(), but then it is needed to use generator expressions,
|
||||
# and most interesting of them are not compatible with Visual Studio :(
|
||||
|
||||
macro(qbt_set_compiler_options)
|
||||
# if (NOT QBT_ADDITONAL_FLAGS)
|
||||
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||
#-Wshadow -Wconversion ?
|
||||
set(_GCC_COMMON_C_AND_CXX_FLAGS "-Wall -Wextra"
|
||||
"-Wcast-qual -Wcast-align"
|
||||
"-Winvalid-pch -Wno-long-long"
|
||||
#"-fstack-protector-all"
|
||||
#"-Werror -Wno-error=deprecated-declarations"
|
||||
)
|
||||
set(_GCC_COMMON_CXX_FLAGS "-fexceptions -frtti"
|
||||
"-Woverloaded-virtual -Wold-style-cast"
|
||||
"-Wnon-virtual-dtor"
|
||||
#"-Weffc++"
|
||||
#"-Werror -Wno-error=cpp"
|
||||
# we should modify code to make these ones obsolete
|
||||
#"-Wno-error=sign-conversion -Wno-error=float-equal"
|
||||
)
|
||||
|
||||
# GCC 4.8 has problems with std::array and its initialization
|
||||
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9)
|
||||
list(APPEND _GCC_COMMON_CXX_FLAGS "-Wno-error=missing-field-initializers")
|
||||
endif()
|
||||
|
||||
include(CheckCXXCompilerFlag)
|
||||
# check for -pedantic
|
||||
check_cxx_compiler_flag(-pedantic _PEDANTIC_IS_SUPPORTED)
|
||||
if (_PEDANTIC_IS_SUPPORTED)
|
||||
list(APPEND _GCC_COMMON_CXX_FLAGS "-pedantic -pedantic-errors")
|
||||
else (_PEDANTIC_IS_SUPPORTED)
|
||||
list(APPEND _GCC_COMMON_CXX_FLAGS "-Wpedantic")
|
||||
endif (_PEDANTIC_IS_SUPPORTED)
|
||||
|
||||
if (CMAKE_SYSTEM_NAME MATCHES Linux)
|
||||
add_definitions(-D_DEFAULT_SOURCE)
|
||||
endif()
|
||||
|
||||
# Clang 5.0 still doesn't support -Wstrict-null-sentinel
|
||||
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||
check_cxx_compiler_flag(-Wstrict-null-sentinel _STRICT_NULL_SENTINEL_IS_SUPPORTED)
|
||||
if (_STRICT_NULL_SENTINEL_IS_SUPPORTED)
|
||||
list(APPEND _GCC_COMMON_CXX_FLAGS "-Wstrict-null-sentinel")
|
||||
endif (_STRICT_NULL_SENTINEL_IS_SUPPORTED)
|
||||
|
||||
# Code should be improved to render this not needed
|
||||
list(APPEND _GCC_COMMON_CXX_FLAGS "-Wno-error=unused-function")
|
||||
else ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||
# GCC supports it
|
||||
list(APPEND _GCC_COMMON_CXX_FLAGS "-Wstrict-null-sentinel")
|
||||
endif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||
|
||||
string(REPLACE ";" " " _GCC_COMMON_C_AND_CXX_FLAGS_STRING "${_GCC_COMMON_C_AND_CXX_FLAGS}")
|
||||
string(REPLACE ";" " " _GCC_COMMON_CXX_FLAGS_STRING "${_GCC_COMMON_CXX_FLAGS}")
|
||||
|
||||
string(APPEND CMAKE_C_FLAGS " ${_GCC_COMMON_C_AND_CXX_FLAGS_STRING}")
|
||||
string(APPEND CMAKE_CXX_FLAGS " ${_GCC_COMMON_C_AND_CXX_FLAGS_STRING} ${_GCC_COMMON_CXX_FLAGS_STRING}")
|
||||
endif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||
|
||||
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
||||
set(QBT_ADDITONAL_FLAGS "/wd4251 /wd4275 /wd4290 /W4" CACHE STRING "Additional qBittorent compile flags")
|
||||
endif ()
|
||||
|
||||
string(APPEND CMAKE_C_FLAGS " ${QBT_ADDITONAL_FLAGS}")
|
||||
string(APPEND CMAKE_CXX_FLAGS " ${QBT_ADDITONAL_FLAGS}")
|
||||
|
||||
# endif (NOT QBT_ADDITONAL_FLAGS)
|
||||
endmacro(qbt_set_compiler_options)
|
17
cmake/Modules/QbtTargetSources.cmake
Normal file
17
cmake/Modules/QbtTargetSources.cmake
Normal file
@@ -0,0 +1,17 @@
|
||||
# a helper function which appends source to the target
|
||||
# sources file names are relative to the the target source dir
|
||||
|
||||
function (qbt_target_sources _target _scope)
|
||||
get_target_property(targetSourceDir ${_target} SOURCE_DIR)
|
||||
set(sourcesRelative "")
|
||||
foreach(source IN ITEMS ${ARGN})
|
||||
if(IS_ABSOLUTE "${source}")
|
||||
set(sourceAbsolutePath "${source}")
|
||||
else()
|
||||
get_filename_component(sourceAbsolutePath "${source}" ABSOLUTE)
|
||||
endif()
|
||||
file(RELATIVE_PATH sourceRelativePath "${targetSourceDir}" "${sourceAbsolutePath}")
|
||||
list(APPEND sourcesRelative "${sourceRelativePath}")
|
||||
endforeach()
|
||||
target_sources(${_target} ${_scope} "${sourcesRelative}")
|
||||
endfunction(qbt_target_sources)
|
48
cmake/Modules/QbtTranslations.cmake
Normal file
48
cmake/Modules/QbtTranslations.cmake
Normal file
@@ -0,0 +1,48 @@
|
||||
# macros to handle translation files
|
||||
|
||||
# qbt_add_translations(<target> QRC_FILE <filename> TS_FILES <filenames>)
|
||||
# handles out of source builds for Qt resource files that include translations
|
||||
# The function generates translations out of the supplied list of .ts files in the build directory,
|
||||
# copies the .qrc file there, calls qt5_add_resources() adds its output to the target sources list.
|
||||
function(qbt_add_translations _target)
|
||||
set(oneValueArgs QRC_FILE)
|
||||
set(multiValueArgs TS_FILES)
|
||||
cmake_parse_arguments(QBT_TR "" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
||||
|
||||
get_target_property(_binaryDir ${_target} BINARY_DIR)
|
||||
|
||||
if (NOT QBT_TR_QRC_FILE)
|
||||
message(FATAL_ERROR "QRC file is empty")
|
||||
endif()
|
||||
if (NOT QBT_TR_TS_FILES)
|
||||
message(FATAL_ERROR "TS_FILES files are empty")
|
||||
endif()
|
||||
|
||||
if(IS_ABSOLUTE "${QBT_TR_QRC_FILE}")
|
||||
file(RELATIVE_PATH _qrcToTs "${CMAKE_CURRENT_SOURCE_DIR}" "${QBT_TR_QRC_FILE}")
|
||||
else()
|
||||
set(_qrcToTs "${QBT_TR_QRC_FILE}")
|
||||
endif()
|
||||
|
||||
get_filename_component(_qrcToTsDir "${_qrcToTs}" DIRECTORY)
|
||||
|
||||
get_filename_component(_qmFilesBinaryDir "${CMAKE_CURRENT_BINARY_DIR}/${_qrcToTsDir}" ABSOLUTE)
|
||||
# to make qt5_add_translation() work as we need
|
||||
set_source_files_properties(${QBT_TR_TS_FILES} PROPERTIES OUTPUT_LOCATION "${_qmFilesBinaryDir}")
|
||||
qt5_add_translation(_qmFiles ${QBT_TR_TS_FILES})
|
||||
|
||||
set(_qrc_dest_dir "${_binaryDir}/${_qrcToTsDir}")
|
||||
set(_qrc_dest_file "${_binaryDir}/${QBT_TR_QRC_FILE}")
|
||||
|
||||
message(STATUS "copying ${QBT_TR_QRC_FILE} to ${_qrc_dest_dir}")
|
||||
file(COPY ${QBT_TR_QRC_FILE} DESTINATION ${_qrc_dest_dir})
|
||||
|
||||
set_source_files_properties("${_qrc_dest_file}" PROPERTIES
|
||||
GENERATED True
|
||||
OBJECT_DEPENDS "${_qmFiles}")
|
||||
|
||||
# With AUTORCC enabled rcc is ran by cmake before language files are generated,
|
||||
# and thus we call rcc explicitly
|
||||
qt5_add_resources(_resources "${_qrc_dest_file}")
|
||||
target_sources(${_target} PRIVATE "${_resources}")
|
||||
endfunction()
|
21
cmake/Modules/bundle.cmake
Normal file
21
cmake/Modules/bundle.cmake
Normal file
@@ -0,0 +1,21 @@
|
||||
set(BU_CHMOD_BUNDLE_ITEMS ON)
|
||||
include(DeployQt5)
|
||||
|
||||
set(plugins "")
|
||||
|
||||
get_property(svgIconPluginLocation TARGET Qt5::QSvgIconPlugin
|
||||
PROPERTY LOCATION_RELEASE)
|
||||
list(APPEND plugins "${svgIconPluginLocation}")
|
||||
get_property(svgPluginLocation TARGET Qt5::QSvgPlugin
|
||||
PROPERTY LOCATION_RELEASE)
|
||||
list(APPEND plugins "${svgPluginLocation}")
|
||||
|
||||
set(sfx "")
|
||||
if(APPLE)
|
||||
set(sfx ".app")
|
||||
elseif(WIN32)
|
||||
set(sfx "${CMAKE_EXECUTABLE_SUFFIX}")
|
||||
endif()
|
||||
|
||||
get_target_property(exe qBittorrent OUTPUT_NAME)
|
||||
install_qt5_executable("${exe}${sfx}" "${plugins}" "" "" "")
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user