This is a regression WRT 5.0.2.
Since 5.1.0, adding to a CMakeLists.txt file the following stanzas:
Makes CMake output:
CMake Error at /usr/lib/x86_64-linux-gnu/cmake/Qt5Widgets/Qt5WidgetsConfig.cmake:15 (message):
The imported target "Qt5::Widgets" references the file
but this file does not exist. Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
but not all the files it references.
Call Stack (most recent call first):
This is avoided by installing the private headers of qt base. But we packagers want to avoid users installing private headers, because we can't guarantee API/ABI stability.
If CMake files are needed for the private headers, they should have separate fooPrivateConfig.cmake files.
There is also the chance that the path /usr/include/qt5/QtWidgets/<qt_version>/ could hold non-private stuff (not the case here), but that doesn't sounds too good because the path is versioned.