[Development] Fwd: About CMAKE_MKSPEC, the spec file recorded in Qt5CoreConfigExtrasMkspecDir.cmake and "using any compiler"

René J.V. Bertin rjvbertin at gmail.com
Mon Feb 25 09:56:42 CET 2019


Trying to get an answer to the question below once more.
In a nutshell: shouldn't the CMAKE_MKSPEC (or some equivalent) be preserved in the installed CMake modules such that the correct mkspec directory is added to the compiler's header include search path?

Or should that directory be excluded altogether?


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) ...


More information about the Development mailing list