Skip to content

botan-config.cmake: Hard-code installation paths? #5030

@reneme

Description

@reneme

TL;DR: Does the botan-config.cmake file need to remain relocatable (via installation directory structure guesswork)? Or could we simplify it by hard-coding the installation paths that our build system dictates (configurable via ./configure.py --prefix --libdir --includedir ...)?


The cmake config file (originally added two years ago) is starting to collect complexity because it tries to be compatible to as many platforms and package managers as possible (1, 2) while maintaining relocatability. Right now, botan-config.cmake is based on a heuristic to find the library's include and library files based on the location of botan-config.cmake itself. This makes the whole installation relocatable (from the cmake config file's perspective that is). For that, it has to actively handle systems that use a target triplet in their library path, or systems that use lib64 instead of lib. On Windows is has to actively find the .lib file accompanying the .dll. I'm sure there are more scenarios where this falls short. And we also don't test all the scenarios we support, so regressions are likely.

Alternatively, we could ditch relocatability (3) and simply render the botan-config.cmake file using the installation path information configure.py provides. The artefact installation locations can be controlled via --prefix, --libdir, --includedir, and perhaps --bindir. botan-config.cmake would then contain an exact set of artefact installation paths tailored to the configured setup without trying to handle all possible configurations found in the wild.

Of course, this assumes that distribution package maintainers actually use those configure.py switches and not just move things in place manually after installing to default locations. Perhaps @thesamesam, @carlosrodfern could provide some input here?

Metadata

Metadata

Assignees

Labels

infraCI, package management, etc

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions