On Thursday, 17 October 2013 12:29:48 CEST, Bartek Taczala wrote:
Hi, Trying to build pure Qt5 version of trojita led me to some
very weird crashes from within libQtCore.so.4. (maybe Qt4 and
Qt5 cannot coexist within one elf?)
Hi Bartek, that's correct; one indeed cannot link with both Qt4 and Qt5 at
the same time.
Here's a patch for CMake
that remove any linking to Qt4 libraries when WITH_QT5 option is
passed to CMake.
This is rather strange; I have been building the Qt5 version for ages and
have never seen a binary linked with both Qt4 and Qt5. What platform are
you on? What version of Qt5?
The patch appears to be doing other things as well, though. In particular,
the Qt5 version would no longer link the individual sub-libraries with
their dependencies -- e.g.:
-target_link_libraries(AppVersion Common ${QT_QTCORE_LIBRARY})
+if(WITH_QT5)
+ qt5_use_modules(AppVersion Core)
+else()
+ target_link_libraries(AppVersion Common ${QT_QTCORE_LIBRARY})
+endif()
This results in libAppVersion.a no longer linking with libCommon.a. That's
a problem for some of the platforms we support.
I do like the qt5_use_modules() approach; Trojita should switch to that.
Anyway, before I merge this, let's find out why is QT_QTCORE_LIBRARY
actually pointing to Qt4. The build system is supposed to *completely*
ignore Qt4 if configured to use Qt5. Have you tried to do something crazy
like switching the existing build tree from Qt4 to Qt5? I.e. have you ever
run `cmake` without the -DWITH_QT5=ON option? Could you please post your
CMakeCache.txt? Could you nuke your build dir and try to build from
scratch, this time making sure you use -DWITH_QT5 from the very beginning?
With kind regards,
Jan
--
Trojitá, a fast Qt IMAP e-mail client -- http://trojita.flaska.net/