Linux CMake will not use version in /opt
Solved
General and Desktop
-
Hi,
Developing on Linux (actually WSL Ubuntu 22.04). I have the Ubuntu QT (6.2) packages installed (to /usr/lib) but I also used the installer to get v6.7.0 at /opt/Qt.I cannot seem to persuade CMake to use the version at /opt!
My command line is this
cmake -DCMAKE_PREFIX_PATH=/opt/Qt/6.7.0/gcc_x64/lib/cmake/Qt6 -DQt6_DIR:PATH=/opt/Qt/6.7.0/gcc_x64/lib/cmake/Qt6 -S . -b linux_build
but the cache and build still use /usr/lib version. Any hints?
-
Ok - I have no idea where I got that "x" in
gcc_x64
- it's justgcc_64
And the correct incantation seems to be
cmake -DCMAKE_PREFIX_PATH:PATH=/opt/Qt/6.7.0/gcc_64 -S . -B linux_debug
UPDATE:
Additionally I neededsudo apt install libglx-dev libg1-mesa-dev
Otherwise it mysteriously failed finding QtGui
-