Unsolved CMake Supporting Qt 5.0 and Qt6
-
Hi All,
I'm migrating on of my projects to Qt6 but I want to keep backwards compatibility with Qt 5.0.2
The suggested workflow in the docs works well for new-ish versions of Qt but when I try with 5.0.2 I get:CMake Error at src/CMakeLists.txt:4 (find_package): Could not find a package configuration file provided by "QT" with any of the following names: Qt6Config.cmake qt6-config.cmake Qt5Config.cmake qt5-config.cmake
What's the minimum supported version of Qt5? Is there any workaround you can think of to make it backwards-compatible with 5.0.2?
System Info:
- Ubuntu 12.04
- CMake 3.2.3
- g++ 6.2
- Qt 5.0.2
-
Partially answer my own question: Qt 5.1.1 works. Now any smart Idea on how to support 5.0?
-
Hi,
The quick and dirty that comes to mind would be to copy/modify the cmake files from a close Qt version and drop them into your 5.0.2 installation.
-
@SGaist Agreed but not viable. It's a library so hacking the Qt installation of the end user is not possible
-
I thought so...
Will it be system Qt or custom installed ?
-
System. I use this ppa for my CI machine
-
@VRonin said in CMake Supporting Qt 5.0 and Qt6:
@SGaist Agreed but not viable. It's a library so i hacking the Qt installation of the end user is not possible
Should a symlink into the binary's build/cmake directory work (I honestly don't know)?
-
@kshegunov said in CMake Supporting Qt 5.0 and Qt6:
Should a symlink into the binary's build/cmake directory work (I honestly don't know)?
Nah, the problem is that the folder
lib/cmake/Qt5
doesn't exist in Qt 5.0 so the necessary root config files are missing -
@VRonin said in CMake Supporting Qt 5.0 and Qt6:
Nah, the problem is that the folder lib/cmake/Qt5 doesn't exist in Qt 5.0 so the necessary root config files are missing
I see, it was a long shot anyway. I'm completely out of my element here.
-
Didn't KDE's ecm module provide a find script for Qt 5 at that time ?