cmake: Support generation of export headers
authorManuel Nickschas <sputnick@quassel-irc.org>
Sun, 2 Sep 2018 21:06:18 +0000 (23:06 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Sun, 18 Nov 2018 10:06:43 +0000 (11:06 +0100)
commitccf1e4557797374c839c567ae14fe12cc1bcffb3
tree1ba7392b5764c2187e67d315dd82c2369e28f55f
parentfb80dab2044d302eb8ccacd0b34d4cbaf5fe904c
cmake: Support generation of export headers

For using shared libraries without globally exporting all symbols,
one has to explicitly mark classes and free functions to be exported.
This is more efficient on platforms like Linux (enabling the use
of -fvisibility=hidden on GCC/Clang), and a hard requirement for
using DLLs on Windows (which don't support global export at all).

Extend the quassel_add_module() macro with an optional EXPORT
argument, which, if provided, uses CMake's built-in support for
generating an export header that provides macros for exporting
symbols. The same macro will also import the marked symbols when
building against a library.

While we're at it, also fix the install rule to use the proper
install locations for RUNTIME/LIBRARY/ARCHIVE target types.
cmake/QuasselMacros.cmake