Commit graph

68 commits

Author SHA1 Message Date
sledgehammer999
f5239ffb0b
CMake: Use installed Qt's translations for packaging 2022-03-29 01:52:23 +03:00
Chocobo1
efc04645b7
Use QString literals
It covers src/webui and enables `QT_NO_CAST_FROM_ASCII`.
2022-03-20 13:33:40 +08:00
Chocobo1
7aa859a442
Don't use deprecated statfs64() on macOS (#15661)
Co-authored-by: Nick Korotysh <kolchaprogrammer@list.ru>
Co-authored-by: Chocobo1 <Chocobo1@users.noreply.github.com>
2021-11-02 10:41:09 +08:00
Chocobo1
e006538514
Fix cmake script (#15309)
Fix up 138c911ef4.
2021-08-11 13:26:15 +08:00
Vladimir Golovnev (glassez)
925bf7715c
Disable functions deprecated in Qt 5.15.2 and earlier 2021-07-15 10:56:49 +03:00
Vladimir Golovnev (Glassez)
2bd2490539 Disable functions deprecated in Qt 5.14 and earlier 2021-06-16 17:56:40 +03:00
Francisco Pombal
0c71756009
CMake: fix MSVC __cplusplus (#13934) 2021-05-27 06:57:22 +03:00
FranciscoPombal
2f6abb8aa1 CMake: fix compiler identification checks 2021-05-26 09:46:08 +03:00
Chocobo1
89559eae2b
Disable clang "range loop analysis" compiler warning
See: https://github.com/qbittorrent/qBittorrent/pull/13915#issuecomment-739449084
2021-01-09 12:59:07 +08:00
Chocobo1
24fa9e32b0
Set source character sets to UTF-8
This suppress warning C4819.
https://docs.microsoft.com/en-us/cpp/build/reference/utf-8-set-source-and-executable-character-sets-to-utf-8?view=msvc-160
2021-01-07 11:51:24 +08:00
Chocobo1
c669401767
Generate version header when configuring project
The basic idea is we create a version header template at
"src/base/version.h.in" and the build systems are expected to replace
strings that are enclosed with @ symbols and generate
"src/base/version.h" for other source files to consume/include.
2021-01-04 22:28:41 +08:00
Chocobo1
d70b893852
Bump project requirement to C++17 2020-12-31 13:28:48 +08:00
jagannatharjun
8696988d53 Fix CMake generated qBittorrent's version string
${qBittorrent_VERSION} will expand to a string that ends with build number but version string from qMake doesn't end with build number
2020-10-02 23:57:03 +05:30
Chocobo1
a675b9305b
Add compile flags from conf.pri.windows file to cmake 2020-09-21 12:16:47 +08:00
Chocobo1
7fed0391ba
Don't impose unnecessary compile options on users
This is unexpected for users that take single job compilation as the
default (which is always the case since forever). Users can change the
default if they wish to use multicore for compilation.
2020-09-18 13:58:45 +08:00
FranciscoPombal
46123b9989 CMake: overhaul and improve scripts
- Bump minimum required version and
make use of more modern language features
- Rely more on target_...() commands to establish dependency
relationships between targets rather than directory property commands
- Improve libtorrent package discovery
- Enable and handle application features more explicitly
- Improve user-facing output
- Fix various compilation issues on Windows (MSVC and MinGW) and macOS
- Improve handling of translations
- Add explanatory comments where relevant
- Make CMake scripts fully independent of qmake files/details
- Remove old functions/macros
2020-09-17 13:13:26 +01:00
jagannatharjun
d355491b85 Use default warning level with MSVC in CMake
Previously used warning level 4 creates a lot of noise that largely come from Qt headers
2020-07-17 14:41:48 +05:30
Vladimir Golovnev (Glassez)
bc05f3f76b
CMake: Fix typo 2020-05-02 17:56:21 +03:00
FranciscoPombal
d593d6baa1 CMake: Enforce minimum C++ mode support 2020-04-28 15:50:16 +01:00
NotTsunami
f066d8d786 CMake: Remove glibc version detection
If we were conditionally enabling _BSD_SOURCE or _SVID_SOURCE, I can
understand trying to play nice with the compiler and only pass as
needed, however this is not the case and glibc <= 2.19 will not care
that we are passing _DEFAULT_SOURCE. This removes an unnecessary
build step and gives us less to maintain from a build system
perspective.

Small cosmetic changes to MacroQbtCompilerSettings are included.
2020-01-19 15:08:37 -05:00
NotTsunami
b7f2122c06 CMake: Remove duplicate MSVC check
As of this commit, L98 of winconf.cmake already checks for MSVC
before winconf-msvc calls this macro, so we are guaranteed to be
satisfy the check.
2020-01-18 09:36:56 -05:00
NotTsunami
451585b5de CMake: Remove additional debugging compiler flags
Our previous setup lead to two unintended consequences:

* Debug flags were included in both release and debug builds instead
of just debug builds
* Clang doesn't support -gX (where X is the level of debugging
optimization), but we checked for -Og support instead

This commit avoids both of these scenarios by removing the additional
flags altogether. Partial resolution to #11856.
2020-01-14 10:18:59 -05:00
Luigi Baldoni
2f83587f2a
Remove -march=native optimisation 2019-12-08 13:13:59 +08:00
Prince Gupta
e3879f9ab9 CMake: Use libraries from winconf.pri 2019-11-12 10:43:25 +05:30
Chocobo1
bb23366912
Fix missing libraries in cmake-mingw build 2019-10-19 14:03:39 +08:00
Chocobo1
ccbd9c83e2
Update libtorrent build defines on Windows
`TORRENT_USE_LIBCRYPTO` replaced `TORRENT_USE_OPENSSL` since OpenSSL 1.1.
`TORRENT_DISABLE_RESOLVE_COUNTRIES` has been removed since libtorrent 1.2.
2019-10-09 10:44:42 +08:00
Vladimir Golovnev (Glassez)
6bfa4370b7
CMake: Fix Windows build 2019-08-06 21:50:39 +03:00
Mike Tzou
ec4240dd06
Merge pull request #11016 from Chocobo1/vista
Raise minimum support to Windows 7
2019-08-06 10:17:11 +08:00
Chocobo1
2f0ae7a7d8
Raise minimum support to Windows 7 2019-08-05 02:31:19 +08:00
Vladimir Golovnev (Glassez)
6fe063146f
CMake: Apply QBT_ADDITONAL_FLAGS on all systems 2019-08-02 19:32:56 +03:00
Vladimir Golovnev (Glassez)
3093751fa4
CMake: Fix compilation on Windows with MSVC 2019-08-02 19:32:53 +03:00
Vladimir Golovnev (Glassez)
38cf1fb3ee
Improve CMake configuration
Don't search for QtSingleApplication library.
Fix building on Windows with MinGW.
2019-07-21 16:41:17 +03:00
Chocobo1
4a90716843
Add override keyword to functions 2019-07-19 11:58:56 +08:00
Chocobo1
752d4b85ea
Remove compiler warning flags
Apperently nobody care about those warnings so just remove them and let
other more important warnings stand out.
2019-07-18 14:54:51 +08:00
Chocobo1
38b6ee9e75
Remove workaround for boost 1.39
... by raising minimum version to 1.40.
Bug report: https://svn.boost.org/trac10/ticket/3095
2019-06-23 11:09:05 +08:00
Mike Tzou
1831f71cc4
Merge pull request #10833 from Chocobo1/invokeMethod
Use functor based QMetaObject::invokeMethod
2019-06-22 11:24:47 +08:00
Prince Gupta
ece70daaa5 Fix CMake Windows compilation 2019-06-21 18:05:19 +05:30
Chocobo1
e47d7fe55c
Remove outdated defines 2019-06-21 01:48:55 +08:00
Eugene Shalygin
e590fff2fe cmake: restore out-of-source build
Qt translations have to be compiled in a shared library or executable,
and since we use static libraries for the components, webui translation
files have to be compiled into the main executable.
2018-10-14 11:06:20 +02:00
Eugene Shalygin
af7b40ecc2 Use proper include files in the QtSingleApplication find module.
Look for qtsinglecoreapplication.h when Qt5Widgets module was not found,
and qtsingleapplication.h otherwise. Fixes #9196.

This also removes Qt4 support from the QtSingleApplication find module.
2018-07-16 11:22:42 +02:00
Eugene Shalygin
0e655b4f9a Fix option name in winconf-xxx.cmake
The mistake was made by commit 7712d0ada0
2018-06-06 14:58:17 +02:00
Eugene Shalygin
fa770871e9 Refactor CMake build scripts
1. Use FeatureSummary module to show configuration results.

2. Invert option()/find_package() relationship: instead of
calling find_package(... REQUIRED) when option is set, rely on optional
find package call and PackageName_FOUND variable.

3. Refactor handling options that result in simple preprocessor defines
(actually copy the snippet from libtorrent) so that everything is done
in a single function call.

4. Populate target properties in order to get rid of
include_directories() calls.
2018-06-05 11:39:11 +02:00
Chocobo1
051ba4fa48
Comment out Werror flag in cmake script
Werror flag should be only enabled on developer's machine, not for
users using the product.
Also fix formatting.
2018-05-07 18:23:47 +08:00
Chocobo1
423511765a
Fix typo 2018-03-14 23:37:08 +08:00
Luís Pereira
058bad0af3 Make it build when using Clang under CMake
The pair Clang/qmake builds.
CMake compiler settings are more strict and it causes clang build to fail.
2018-02-26 19:53:39 +00:00
Eugene Shalygin
0ad5290389 cmake: do not use Qt5Widgets when locating QtSingleApplication. Closes #7551.
This fixes cmake builds with GUI disabled and system
QtSingleApplication. We rely on Qt5::Core instead of Qt5::Widgets.
2017-10-07 21:48:52 +02:00
Chocobo1
39b56ac598
Move NOMINMAX define 2017-08-29 13:39:01 +08:00
Eugene Shalygin
c614c66535 Install required plugins into bundle
Install platform and svg plugins into bundle. Update dependencies in
Travis.
2017-07-14 17:42:02 +02:00
Eugene Shalygin
74cecb1b6c Replace C-style casts with C++ ones 2017-05-29 17:25:42 +02:00
Eugene Shalygin
15ef4fcc56 cmake: fix FindSystemd.cmake
Apparently, recent version of CMake made PkgConfig stuff scooped and we
need to call find_package(PkgConfig) in FindSystemd.cmake too, the call
in FindLibtorrentRasterbar.cmake, that is always used first, is not
enough now.
2017-05-19 10:44:36 +02:00