Qt6 - cmake
-
Hi,
How did you install Qt 5 ?
How did you install Qt 6 ?
Do you have any custom software installed that makes use of Qt ? -
@SGaist Appreciate the response
Qt5 was installed using the online installer and qmake
Qt6 was installed using the online installer a cmakeThe Kit when installing Qt6 informed me i needed to upgrade cmake, I switched it to default to the cmake that came with Qt6.
Im sure there are tons of programs on the box that use Qt, Im the only person using QtCreator to build software on the box.
What ever is generating the CMakeLists.txt does not seem to detecting the version correctly.
-
Good, do you have any other Qt installed through e.g. macports or brew ?
Could you test on the command line to see if you have the same issue ? I am just wondering whether Qt Creator may have some leftover settings interfering.
-
Ok, which Qt 6 release did you install exactly ?
-
The plot thickens...
I just switched to my linux machine and name issue
find_package(Qt5Core)Mac -
I had removed Qt and did a fresh install.
Newest Qt 6.0Linux -
Have Qt 5.12. and and 15.5.0
Ran the maintenance tool, updated all existing
Reran - installed Qt 6.0
Same issues on the linux box -
@rootshell said in Qt6 - cmake:
CMakeLists.txt
Can you share your CMakeLists.txt file?
Are you sure you point to the correct source directory in the cmake command? -
I just tested using
cmake -DCMAKE_PREFIX_PATH=~/Qt/6.0.0/gcc_64/lib/cmake ..
using one of Qt's example copied in a random folder and it worked properly nothing searched from Qt 5. -
@SGaist - I am having a very similar issue. Trying to port Qt5 to Qt6. on ubuntu 22.04.
I had previously installed Qt5 packages with apt install - I removed all of those with apt remove. I installed Qt6.7.2 with the online installer into directory ~/Qt6. Now cmake find_package() succeeds when I set CMAKE_PREFIX_PATH to ~/Qt6/6.7.2/gcc_64/lib/cmake/:find_package( Qt6 COMPONENTS Gui Widgets Quick REQUIRED)
But cmake fails on the target with:
CMake Warning (dev) in src/qt-test2/CMakeLists.txt: AUTOGEN: No valid Qt version found for target qt-test. AUTOMOC, AUTOUIC and AUTORCC disabled. Consider adding: find_package(Qt5 COMPONENTS Widgets) to your CMakeLists.txt file.
What am I doing wrong?
-
-
@Christian-Ehrlicher - Not intending to hijack anything - this thread is very relevant to my current issue.