cmake: Modernize (and fix) deployment on macOS For the past decade or so, we have used a bunch of self-written python and bash scripts for creating packages for macOS. These have not aged well, and recently several workarounds had to be hacked in to keep the machinery somewhat working at all. Still, invoking the scripts at build time rather than install time caused a race condition where sometimes not all the packages would be created in CI. To break the camel's back, deploying dependencies no longer worked correctly and broke the packages completely in 0.14-rc1. Fix this by modernizing the whole deployment process and related parts of the build system, replacing the custom scripts by relying on Qt's and CMake's own tooling instead. Some workarounds still need to be added to that to make everything work correctly (neither tool can deal correctly with QtWebEngine, for some reason, and CMake's Info.plist template lacks functionality), but the main part of the work is now delegated to official tooling, everything properly happend at install time avoiding race conditions in the build process, and we can remove a bunch of decade-old and hardly maintained custom code. Also adapt the CI configuration to use -DBUNDLE instead of the old -DDEPLOY, and remove the explicit setting of qmake's path too, as it is no longer needed now.
test: Add build system support and a main function for unit tests Add a new CMake option BUILD_TESTING (defaults to OFF) that, if enabled, will build unit tests and related requirements. Add a new library Quassel::Test::Main that provides a main function for test cases. Add a new CMake macro quassel_add_test for making the adding of test cases convenient by hiding most of the boilerplate. Test cases should #include "testglobal.h", so they automatically have access to GTest/GMock macros as well as the imported main function.
cmake: Modernize build system Move to the modern, property-based way of using CMake. This simplifies a lot of things: - No need to manually specify interface include dirs and libraries of dependencies - No need to carry around variables - Clear separation of local and global dependencies and definitions - No need for hacks to make the triple-executable thing work Provide convenience functions to set up library and executable targets. This will make it very easy in the future to split up some modules, as well as move towards using shared libraries. Use the modern, property-based way of using Qt, too. This removes the need for the deprecated qt5_use_modules() macro, and a bunch of manual things we had to do to get the compile flags right for the different Quassel executables. Also make use of CMake's AUTOUIC and AUTORCC to avoid a bunch of boilerplate for dealing with .ui files and Qt resources. Move the .ui files from their subdirectory into the qtui directory, since the separation doesn't really make too much sense. We'd rather want to split the QtUi module into smaller parts/libraries. Remove a bunch of unnecessary stuff from the CMake files.
cmake: Remove support for building static binaries Building and running static binaries has become increasingly difficult on modern systems, in particular when involving complex libraries like Qt due to their reliance on plugins and other dynamically loaded resources. It is also a security risk, as upgrades to system libraries won't apply to the static binary. Having a static quasselcore binary was quite useful when it was hard to get Qt on an X11-less box, but these days all major distros support modular Qt, and can provide Quasselcore packages that don't require graphical dependencies. Consequently, we no longer intend to offer static binaries. Thus, remove the corresponding hacks from the build system.
cmake: Remove build system support for Qt4/KDE4 In our quest to modernize the codebase, remove support for the long-dead Qt4 libraries (and consequently, also for integration into KDE4) from the build system.
Set RUNTIME_OUTPUT_DIRECTORY instead of abusing OUTPUT_NAME This resolves an error when building with ninja: ninja: error: build.ninja:4374: multiple rules generate quasselcore
Adapt macosx_makePackage.sh for svg icon support Resolves GH-234.
Add and Initialize Icon Themes
Fix Mac Deploy scripts for newer Xcode and git Resolves GH-229.
Remove arguments of CMake's else() and endif() commands The need for them is long gone, but they are still permitted. Remove the remaining instances to make the code more consistent.
Simplify the handling of the contributor list in AboutDlg This introduces an AboutData class akin to KAboutData from KDE Frameworks. Together with brace initialization, which we can now use thanks to C++11, this makes specifying the (huge!) list of contributors to Quassel much nicer, compared to editing a long HTML string. AboutData also can create a KAboutData object that can be used for KF5 integration, and later for showing the native KAboutDialog instead of our own if KDE integration is enabled. The list of contributors has also been synced with the Git history again. If you find your name missing, or want changes, please let us know.
Prepare build system for KDE Frameworks support Besides setting everything up for finding frameworks, this commit also changes the handling of install paths. We now support the standard CMake variables of the form CMAKE_INSTALL_<TYPE>_DIR, which can be overridden on the command line. If KDE integration is enabled, the default paths set by KDE (4 or frameworks) will be used. Some additional cleanups were done in passing, too.
Build mono client packages on Mac OS X When deploying on Mac OS X, also build a disk image (dmg) for the mono client. Also updated cmake files for OS X 10.8.
Make --syslog option work again The -DHAVE_SYSLOG was missing for compiling main() after the recent build system changes, so the option wasn't enabled (but caused a warning).
Bring back COMMON_DEPS This is actually being used to link the app icon on Windows, so bring the old variables back for now. Probably want to clean this up later though, as the naming is confusing.
Fix Qt resource handling Turns out we have to explicitly initialize Qt resources that are linked statically, so our last build system change broke things because the files where nowhere to be found. This now initializes the resources in main(); additionally, we use absolute paths for the qrc files now, simply for making things a bit clearer.
Avoid race conditions in the build system Adding resource files in multiple targets is a bad idea, because CMake will happily generate them multiple times too, and unfortunately also in the same location. With Qt5, this actually lead to a misgenerated oxygen_kde.qrc some times. Now we add the resources in the module they belong to, which not only avoids these race conditions, but also saves some time during compile, because every resource file is only processed once now. Changing this triggered yet another race condition, where not all translations would be generated by the time the corresponding .qrc was needed. Adding a fugly add_dependencies(mod_common po) fixes this; however we may want to find a cleaner way to properly express deps between the language files and the qrc.
Fix handling the QtMain module on Windows Turns out that the QtMain module can't be used in qt4_use_modules, and we should just add the library to our targets.
Completely rework the dependency handling in the build system Traditionally, optional build dependencies are handled in CMake via offering options and conditionally searching for the needed packages. This leads to having lots of options, boilerplate for telling the user which features are enabled or not, unclear handling of automagic dependencies, and so on. These days, CMake offers a much nicer way: feature_summary() and friends. To make use of this, one calls find_package unconditionally and then sets properties on the package that tell CMake if the dependency is optional or required, its purpose, a description of the package etc. At the end of configuration, CMake then displays a nice summary of all the packages searched for and (not) found, as well as other features. Quassel now makes use of this modern way of specifying dependencies, replacing most of the former options (they're still there, but unused now, and will be removed soon). Note that one can still disable an optional dependency Foo by passing -DCMAKE_DISABLE_FIND_PACKAGE_Foo=TRUE to CMake. I also took the opportunity to radically clean up and fix how we handle dependencies throughout the build system: * We no longer set an extra CMake variable to indicate that a package was found, but use the Foo_FOUND variable directly * Compile definitions and include directories are no longer set globally in the root CMakeLists.txt, but in the Quassel modules where they're actually needed; this should speed up compiling ever so slightly and generally make things much cleaner * Libraries are now linked directly to the Quassel modules that use them, rather than to the executable. This prepares us for making the modules shared libraries at some point, and is anyway The Right Thing™ to do * Fully support Qt5 in the build system, including finding the proper version of dependencies where appropriate and available Note that the changes to the build system are not complete yet, and some things may be broken now. Note also that while Qt5 is now supported in the build system, the code itself still requires many changes to actually compile with Qt5, so don't even try.
Improve the CMake option stuff We now use cmake_dependent_option() to express dependencies between the various options that you can give to CMake for configuring Quassel; for example, enabling KDE4 now forces some options to OFF regardless of the user-selected value (which will, however, be preserved in case KDE integration is disabled again later). This also renames WITH_QT5 to USE_QT5 (and adds a USE_QT4, too); this seems to have emerged as the standard way to select a Qt version for dual-Qt packages. However, Qt4 is still selected by default unless you force Qt5 by setting the USE_QT5 flag. BTW, don't get your hopes up, Qt5 support is still broken... Once it's working, we may select Qt5 as default for certain platforms. Additionally we renamed QT to QT_PATH to make the function of this flag more clear.