On Monday, 25 February 2019 09:56:42 CET René J.V. Bertin wrote:
> Hi,
> 
> 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?

Hey,

The header include path is part of the _qt5_corelib_extra_includes CMake var.

See:

% ag -s mkspecs /usr/lib/x86_64-linux-gnu/cmake/Qt5Core/
/usr/lib/x86_64-linux-gnu/cmake/Qt5Core/Qt5CoreConfigExtrasMkspecDir.cmake
2:set(_qt5_corelib_extra_includes "${_qt5Core_install_prefix}/lib/x86_64-
linux-gnu/qt5//mkspecs/linux-g++")

That's what you're looking for, right?


If I instead build Qt5 myself using Clang, I end up with this location in the 
.cmake file:

% ag -s mkspecs lib/cmake
lib/cmake/install/Qt5Core/Qt5CoreConfigExtrasMkspecDir.cmake
2:set(_qt5_corelib_extra_includes "${_qt5Core_install_prefix}/.//mkspecs/
linux-clang")

Looks all fine to me?

Regards,
Kevin

 
> Or should that directory be excluded altogether?
> 
> R.
> 
> -------------------------------
> 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.
> _______________________________________________
> Development mailing list
> [email protected]
> https://lists.qt-project.org/listinfo/development


-- 
Kevin Funk | [email protected] | Senior Software Engineer
KDAB (Deutschland) GmbH, a KDAB Group company
Tel: +49-30-521325470
KDAB - The Qt, C++ and OpenGL Experts

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
Development mailing list
[email protected]
https://lists.qt-project.org/listinfo/development

Reply via email to