build: Allow building gpgmepp as static library
* CMakeLists.txt: Add options ENABLE_SHARED (default ON) and ENABLE_STATIC (default OFF). Build tests only with the shared library. * src/CMakeLists.txt: Add target Gpgmepp for the shared library if ENABLE_SHARED is true. Add target GpgmeppStatic for the static library if ENABLE_STATIC is true. Set sources, includes, properties, etc. only for enabled targets. If the shared library isn't built then generate the export header with a dummy shared library. Install the cmake config files only for the shared library.
This makes it possible to build gpgmepp as shared library and as static
library in the same build (as with autotools). The cmake config files of
shared and static target cannot be shared. Since we only need the
static library for gpgol which uses the pkg-config file we create the
cmake config files only for the shared library.
- GnuPG-bug-id: T7262