Home GnuPG

build: Move common cmake and compiler settings to cmake modules

Description

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.

Details

Provenance
ikloeckerAuthored on Dec 17 2024, 3:52 PM
Parents
rGPGMEQTac7440f81af3: build: Add support for cmake and remove support for autotools
Branches
Unknown
Tags
Unknown

Event Timeline