-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot build against Qt5 if Qt6 is installed #1097
Comments
Can you test #1082 |
This PR contains no Qt related CMake changes, so it won't fix the Qt5 issue described here. |
This is how Qt suggests to support QT 5 and 6 |
Do you need support for Qt<5.15? |
OK, I see, at least Windows is stuck behind: DigiDoc4-Client/.github/workflows/build.yml Line 135 in 0b158fc
|
Currently yes. Ubuntu 18.04 (Qt 5.9) is still supported target. |
It still seems off to effectively force Qt6 usage if both Qt6 and Qt5 are installed, but since Qt6 works (for me on OpenBSD) I'll just stick to that and refrain from changing the CMake detection logic. Maybe the versionless approach can be adapted once support for the last Qt<5.14 platform (Ubuntu 18.04) has been dropped? |
I am also looking forward for this day. Ubuntu 18.04 LTS has standard support until April 2023. |
#991 introduced
DigiDoc4-Client/CMakeLists.txt
Lines 17 to 18 in 0b158fc
which effectively prevents using Qt5 if Qt6 is installed.
Usually
-D CMAKE_DISABLE_FIND_PACKAGE_<PackageName>=ON
can be used to hide installed packages,but
REQUIRED
prevents this.Even without
REQUIRED
, due to the use ofNAMES
one had to pass-D CMAKE_DISABLE_FIND_PACKAGE_QT=ON
instead of-D CMAKE_DISABLE_FIND_PACKAGE_Qt6=ON
to neuterDigiDoc4-Client/CMakeLists.txt
Line 17 in 0b158fc
which in turn would cause
QT_VERSION_MAJOR
to be undefined and thus breakDigiDoc4-Client/CMakeLists.txt
Line 18 in 0b158fc
Passing
-D CMAKE_DISABLE_FIND_PACKAGE_Qt6=ON
would equally break line 18, as can be seen here:So to buid against Qt5 one must either remove Qt6 from their system or patch line 17, e.g.
One way to fix this is to introduce a CMake option like so:
I have not opened a PR for this approach yet as there may be other ways.
Qt5 support is probably not going away soon, so it should keep working regardless of whether Qt6 is installed or not.
The text was updated successfully, but these errors were encountered: