Commit Graph

83 Commits

Author SHA1 Message Date
Martchus 8d9b6d845d WIP: Avoid re-configuring built-in icons all the time
It is quite slow and it should be fine doing it only once one
the first configuration
2022-07-18 23:14:26 +02:00
Martchus 752c8cdc71 Link builds using static Qt also against Wayland shell integration plugins
These are required; the Wayland integration plugin alone is not sufficient.
2022-05-02 20:15:07 +02:00
Martchus 8a4b865c28 Improve linking against static Qt plugins
* Detect a static Qt build and link against Qt plugins automatically in
  that case (without the necassity to set `STATIC_LINKAGE`)
* Add offscreen support on UNIX platforms as it is useful for testing on
  headless systems
* Add wayland support if available
* Populate `QT_TEST_LIBRARIES` in case we're not building an app because
  the plugins are still required when building tests
2022-04-28 21:42:33 +02:00
Martchus 9b559b153c Fix TLS support for static builds when using Qt 6.2.0 or newer
This Qt release "pluginized" the backends for TLS support so we need to
make sure to link against at least one TLS plugin since all of my
applications which use Qt Network expect TLS to work.
2021-10-02 19:39:51 +02:00
Martchus b51ac8c322 Improve comments for configuring Qt style plugins 2021-10-02 19:28:54 +02:00
Martchus 7765e6f062 Fix typos found via `codespell --skip .git -w` 2021-07-03 19:14:13 +02:00
Martchus 4cadb04b44 Apply CMake format 2021-03-20 21:01:24 +01:00
Martchus 5960c21558 Fix finding linguist tools macro when cross compiling with Qt 5
When cross compiling with Qt 5 the QT_HOST_PATH variable might
be set as well but the module might not be installed within the
host path. So let's do the usual lookup first and fallback to
QT_HOST_PATH only if that doesn't work.
2021-01-06 23:44:09 +01:00
Martchus d6ea2ac378 Apply cmake-format and clang-format 2020-12-20 17:56:35 +01:00
Martchus 746615e21e Make loading LinguistTools module work when cross-compiling with Qt 6 2020-12-19 20:58:29 +01:00
Martchus 7183ec501c Disable auto-inclusion of QML plugins
because these seem to pull in unwanted dependencies like PostgreSQL
2020-12-10 19:19:02 +01:00
Martchus 9bc3555c99 Resolve QT_INSTALL_TRANSLATIONS via CMAKE_PREFIX_PATH if it is relative
The variables provided by Qt 6 might just contain a relative path. This
change adds an extra function resolve these via CMAKE_PREFIX_PATH and
CMAKE_FIND_ROOT_PATH.
2020-11-11 18:51:19 +01:00
Martchus d80302d20d Make list of Qt's translations even if not available at build time
We shouldn't require translations to be installed at build time to know for
which repositories translations need to be loaded at runtime.
2020-11-11 18:11:43 +01:00
Martchus d61f32a635 Allow to disable built-in translations for Qt's own translations 2020-11-11 18:08:02 +01:00
Martchus 0a67d7dc15 Avoid hard-coding Qt version 2020-11-07 22:05:54 +01:00
Martchus 0f05beebd8 Cope with CMAKE_FIND_ROOT_PATH containing more than one path
According to the documentation CMAKE_FIND_ROOT_PATH is a list.
2020-11-07 22:02:10 +01:00
Martchus f59c2cb643 Fix detecting QXcbIntegrationPlugin
The variable QT5_Gui_STATIC_PREFIX is no longer used.
2020-11-07 21:58:54 +01:00
Martchus 75b992bfd1 Don't install translations if built-in anyways 2020-10-30 22:45:56 +01:00
Martchus 9b7ad3375c Avoid hard-coding Qt version in function invocations
* Make use of "Version-less CMake targets", see
  https://www.qt.io/blog/versionless-cmake-targets-qt-5.15
* Keep fallbacks for compatibility with Qt < 5.15
* Remove some other occurrences of hard-coded Qt versions
2020-04-27 23:47:08 +02:00
Martchus 54e8ef75cd Fix comments mentioning qtconfig.h
There is a separate Qt-specific header since v6.
2020-03-17 19:56:32 +01:00
Martchus d33cf13923 Apply cmake-format 2020-03-08 13:51:36 +01:00
Martchus 031378e1c5 Fix remaining install dirs to use GNUInstallDirs consistently 2020-02-13 11:43:29 +01:00
Martchus fc76422d01 Use GNUInstallDirs
See https://github.com/Martchus/cpp-utilities/issues/17
2020-02-01 00:01:37 +01:00
Martchus b8d00d27c9 Apply cmake-format v0.6.0 2019-11-30 17:58:56 +01:00
Martchus ff48e464fa Improve lookup of Qt translations
* Show warning if no translations found but built-in
  translations are enabled
* Don't write empty QStringLiteral to config file
* Simplify CMake code
2019-08-10 00:12:05 +02:00
Martchus 95cc1a5b78 Apply cmake-format 2019-08-07 22:57:31 +02:00
Martchus a40d2974e0 Fix translation lookup if config name is set
In this case the config name must only be appended to the applications
config directory but *not* to the name of the translation file itself.
2019-08-07 22:57:17 +02:00
Martchus d3c9653b9e Add EXCLUDED_FILES variable
When adding source files to the _FILES variables conditionally
those are so far not being formatted or translated. Adding
these files at least to the EXCLUDED_FILES will fix this.

Replaces DOC_ONLY_FILES which served the same purpose but was
limited to documentation.
2019-07-13 14:01:52 +02:00
Martchus 666e16725d Don't add QT_DISABLE_DEPRECATED_BEFORE by default 2019-06-25 14:16:40 +02:00
Martchus ec3d68a635 Apply cmake-format 0.5.1 2019-06-01 12:15:48 +02:00
Martchus 72d0e9e6e0 Adapt search path for translations to new config system 2019-05-05 18:37:24 +02:00
Martchus 2ae98f8ba4 Prevent using deprecated Qt features 2019-05-04 22:16:46 +02:00
Martchus d8333f3793 Apply cmake-format 2019-05-04 21:01:06 +02:00
Martchus 850101dce6 Support installing multiple configurations within the same prefix 2019-05-03 01:03:41 +02:00
Martchus 76f70abdf8 Polish CMake modules 2019-04-22 22:27:00 +02:00
Martchus c707591128 Don't mix building static and shared libraries 2019-04-21 16:44:54 +02:00
Martchus 190e58fe67 Apply cmake-format 2019-02-06 17:32:10 +01:00
Martchus ccca2f123a Don't care about policy CMP0071 too much
Seems like CMake under Leap is too old so don't enforce
the policy (for now).
2018-03-13 19:57:44 +01:00
Martchus 0409b77831 Split Qt-specific config from other config
So adding Qt-specific config does not require a change
in c++utilities anymore.
2018-03-07 18:22:53 +01:00
Martchus 4980c8df95 Ensure generated sources are processed by AUTOMOC and AUTOUIC 2018-03-07 18:21:47 +01:00
Martchus e6e968e4ea Fix locating Qt's translations under openSUSE 2018-02-10 20:06:45 +01:00
Martchus ad1e6d21ba Prevent installing built-in Qt translations 2018-01-20 22:33:45 +01:00
Martchus 29a2f993a3 Configure static Qt Widget style plugins
* Fix missing "Vista style" in static, Qt 5.10 based
  Windows build
* Required since the platform styles have been
  "pluginized" in Qt 5.10
* See 4f3249f32d
2017-12-15 20:22:29 +01:00
Martchus 591325aa44 Execute target for updating translations not by default 2017-10-16 09:56:35 +02:00
Martchus d65835be50 Link only applications against static Qt plugins
* Which plugins should be included should only be decided
  when building the final application and not before.
* Also prevents those libs from appearing in pkg-config
  files.
2017-10-08 19:27:31 +02:00
Martchus ff4f495a5d Make translations of dependencies always available
And not only if the project itself contains translations
2017-09-08 16:46:35 +02:00
Martchus bf1519d357 Improve handling static Qt plugins
* Only link targets using static Qt Gui/Widgets/Quick
  against static plugins since currently only GUI-related
  plugins are relevant
* Don't require to link explicitely against the related
  module (eg. Qt Svg for the Svg icon engine) because the
  imported target of the plugin should pull all required
  dependencies
* Add option for linking against static Qt image format
  plugins
* Link GUI applications using static Qt Gui/Widgets/Quick
  against the static X11 platform integration plugin if it
  is available
2017-09-03 18:03:41 +02:00
Martchus b94c23f238 Distinguish exporting/enabling resources of static libs
Required because we now allow to provide dynamic libs as
dependencies of static libs
2017-08-31 02:14:52 +02:00
Martchus b45f2e7edf Don't include static svg plugin if not using static Qt 2017-08-20 02:23:02 +02:00
Martchus 260b8217da Use Svg module when linking statically against related plugins
Seems to be required, otherwise getting linker errors.
2017-08-11 22:13:44 +02:00