build: Move common cmake and compiler settings to cmake modules
* CMakeLists.txt: Don't set a few variables. Include G10CMakeSettings and G10CompilerSettings. * cmake/modules/G10CMakeSettings.cmake, cmake/modules/G10CompilerSettings.cmake: New. * src/CMakeLists.txt: Don't set include directories for PRIVATE and PUBLIC scope.
The files G10CMakeSettings.cmake and G10CompilerSettings.cmake are
based on the corresponding KDE* files from KDE's Extra CMake Modules.
The same files are used for the C++ bindings. G10CompilerSettings adds
a few compiler definitions that were also added by autoconf, e.g.
_GNU_SOURCE, _LARGEFILE64_SOURCE, _FILE_OFFSET_BITS=64 (if needed),
and, for Windows builds, WIN32_LEAN_AND_MEAN, UNICODE, _UNICODE,
_USE_MATH_DEFINES, NOMINMAX.
The variables PACKAGE_STRING and PACKAGE_VERSION are not used. The
other variables previously set in the top-level CMakeLists.txt file
are set by G10CompilerSettings.
The PRIVATE and PUBLIC include directories are added automatically by
cmake due to the settings in G10CMakeSettings.
- GnuPG-bug-id: T7262