[Interest] About CMAKE_MKSPEC, the spec file recorded in Qt5CoreConfigExtrasMkspecDir.cmake and "using any compiler"
René J.V. Bertin
rjvbertin at gmail.com
Tue Feb 5 10:48:29 CET 2019
Hi,
I just noticed something strange in the huge compiler commandlines you tend to get while building KDE applications. An application configured to build with clang adds qt5/mkspecs/linux-g++-64 to the header include path (with -isystem, at that).
At first I thought this was an error in that my Qt install (5.9.7, FWIW) was built with GCC but since a release or two I changed to building Qt with clang too.
Now, I think it's not entirely relevant whether or not this particular setting is a left-over due to me not trashing the entire Qt build directory before rebuilding with clang. The fact is that you should be able to build Qt with one compiler and dependent software with another.
Am I overlooking an existing way to get the correct mkspec directory added to the header search path?
The source for Qt5CoreConfigExtrasMkspecDir.cmake suggests this is set via CMAKE_MKSPEC but that variable is no longer referenced in the installed cmake modules (again, in Qt 5.9). So even setting this on the commandline doesn't have any effect - but CMake should be able to infer at least the most common mkspec dirnames from CMAKE_CXX_COMPILER(_ID) ...
Thanks,
R.
More information about the Interest
mailing list