building KF5 projects against a different Qt5 version (than the one the KF5 frameworks were built against)

René J.V. Bertin rjvbertin at gmail.com
Sat Apr 25 13:23:34 BST 2020


Hi,

A priori Qt guarantees that you can run binaries against a different, newer Qt version than they were built against, as long as no private APIs are used. This also works if that newer Qt version is installed elsewhere, provided you set LD_LIBRARY_PATH correctly (and possibly LD_PRELOAD). I think this also means you can build code against such a newer (test) Qt install even if that code uses libraries which were built against the older Qt version (as long as no mixups occur at runtime; I've done this successfully with code that uses Phonon, for instance).

I'm not having a lot of luck building code that uses KF5 frameworks this way. Even after getting cmake to find the intended newer Qt version I still get header conflicts because something inserts unwanted header search paths.

I don't expect there to be official support for this kind of tricky things. Still, testing code against a new Qt version installed in parallel doesn't seem to be such an usual thing to do so if there is a trick to this I'd love to hear it. Is there a way to insert a `-isystem /path/to/new/qt/include` BEFORE the `-isystem /path/to/system/qt/include` that gets added by cmake, for instance?

Thanks,

R.


More information about the Kde-frameworks-devel mailing list