From: Manuel Nickschas Date: Wed, 19 Mar 2014 20:00:07 +0000 (+0100) Subject: Simplify handling of (dual-)Qt in the build system X-Git-Tag: 0.11.0~102 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=5b43f2776fa53bfe15a5b3b4398dfe3e931d5802;hp=5b43f2776fa53bfe15a5b3b4398dfe3e931d5802 Simplify handling of (dual-)Qt in the build system We've used a somewhat complex way to link the various targets to the required Qt libraries (and use the correct defines and CFLAGS...), because when that stuff was written, there were no target properties in CMake, and thus it was not easily possible to build targets within the same scope with different settings. Therefore, we couldn't use the QT_USE_FILE and had to write our own library handling. These days, target properties exist, and Qt5 came up with a nice way to attach the needed properties based on the Qt modules in use: qt5_use_modules() This was later backported to Qt4, too, replacing the old way of having to include QT_USE_FILE which would then set global variables. We now make use of this; because qt4_use_modules() only showed up in CMake 2.8.10, we've copied that function. It will be used only if it's not present in CMake proper. As a bonus, I've also wrapped all the qt-related macros into functions that do the check for the Qt version we want to build against, and select the proper macro to call, thus removing lots of WITH_QT5 conditionals from the rest of the build system. Note that Qt5 support is still incomplete, anyway. ---