Qt Autogen gets disabled in CMake 3.14 even though Qt was found
I use Qt AUTOMOC, AUTOUIC and AUTORCC with Qt4. Qt and its binaries are in a custom directory, so I specify QT_QMAKE_EXECUTABLE
and then call
find_package(Qt4 "4.8.7" REQUIRED QtCore QtGui QtNetwork)
This worked until at least CMake 3.12.4.
Now I tried to use the same code with CMake 3.14.1 and get the error
AUTOGEN: No valid Qt version found for target NxProfiler. AUTOMOC, AUTOUIC
and AUTORCC disabled. Consider adding:
find_package(Qt4 COMPONENTS Widgets)
to your CMakeLists.txt file
and of course the Qt files are not generated anymore. I don't think this should happen, because Qt was actually found correctly. The targets (e.g. Qt4::QtCore
) exist and can be linked. QT_UIC_EXECUTABLE
and QT_MOC_EXECUTABLE
are set to the correct paths as well.
As far as I saw in the code, the Qt version and the path to the tools are the only things that get checked when showing this warning and they should actually be filled out correctly. Is it missing anything else or is this a bug?