Cmake doesn't find Qt cmake config on Linux


#1

For several months now, I am unable compile High Fidelity from Git master, on my Linux openSUSE Tumbleweed x64 machine. Cmake complains about SetupQt.cmake missing the Qt config, although to my knowledge I should have all of the relevant Qt5 development packages installed.

The setup appears to look for it under /home/username/Qt/5.9.1/gcc_64/lib/cmake which is totally incorrect and definitely not where any development files would be located. This leads me to believe it might be a cmake path detection issue.

Can other openSUSE Tumbleweed users replicate this? If so is it an issue that can be fixed in the Cmake setup of Hifi? Here is my console output when running the cmake command:

-- Build server:    ON
-- Build client:    ON
-- Build tests:     ON
-- Build tools:     ON
-- Build installer: ON
CMake Error at cmake/macros/SetupQt.cmake:75 (message):
  Unable to locate Qt cmake config in /home/mircea/Qt/5.9.1/gcc_64/lib/cmake
Call Stack (most recent call first):
  CMakeLists.txt:69 (setup_qt)


-- Configuring incomplete, errors occurred!
See also "/home/mircea/Games/SecondLife/HighFidelity_GIT/build/CMakeFiles/CMakeOutput.log".

#2

You have to implicitly set your Qt location - reasoning at end of message.

With;

export QT_CMAKE_PREFIX_PATH=/usr/lib/x86_64-linux-gnu/cmake
or cmake -DQT_CMAKE_PREFIX_PATH=/usr/lib/x86_64-linux-gnu/cmake

Where /usr/lib/x86_64-linux-gnu/cmake = path on your system where you would see something like (this is Ubuntu 17.10 for instance);

user@u1710:~$ ls /usr/lib/x86_64-linux-gnu/cmake

PulseAudio Qt5Designer Qt5Network Qt5Qml Qt5ScriptTools Qt5WebEngine Qt5Xml
Qt5 Qt5Gui Qt5OpenGL Qt5Quick Qt5Sql Qt5WebEngineCore Qt5XmlPatterns
Qt5Concurrent Qt5LinguistTools Qt5OpenGLExtensions Qt5QuickTest Qt5Svg Qt5WebEngineWidgets SDL2
Qt5Core Qt5Multimedia Qt5Positioning Qt5QuickWidgets Qt5Test Qt5WebSockets
Qt5DBus Qt5MultimediaWidgets Qt5PrintSupport Qt5Script Qt5WebChannel Qt5Widgets

HiFi seems to intentionally (and probably for most case - rightfully) not default to looking for Qt in the “proper” places as most distributions are using unsupported older versions in the official locations. Tumbleweed, Debian 10 and Ubuntu 17.10 – for the moment – have the correct 5.9.x versions in place.


#3

Ahhh… I understand. I can see the logic in that, though as an end user it only confused me for some time as I thought this was a bug and didn’t know how to fix it. I’d normally suggest defaulting to the classic paths and just checking the versions for compatibility, but the developers know best.

Anyway adding the parameter -DQT_CMAKE_PREFIX_PATH="/usr/lib64/cmake" to cmake works perfectly fine, at least as far as configuration goes. So that fixes the problem. Thanks for clarifying this!