Having the version available in CMakeLists.txt lets cmake use the
version (e.g. in the following commit which generates a tar file).
Moreover it improves ccache hits drastically as this no longer needs to
pass version/tags via defined and instead only the version.cpp file has
to be rebuilt if a git tag or version changes.
This also simplifies how the version gets parsed to use std::from_chars
and a std::array<uint16_t,3> rather than a struct, which lets `<` work
for version comparison.
- loki_add_subdirectory was a unnecessary wrapper around
add_subdirectory: it was an attempt to make an idempotent version of
add_subdirectory, but that isn't needed at all and just adds cruft: the
top-level CMakeLists.txt already includes all the subdirectories so we
can just trust it.
- removed incorrect subdirectory "project()" definitions.
- crypto/CMakeLists.txt pointlessly listed all headers in the source
list.
- set c++ standard in the top-level makefile instead of on each target
since we intentionally want it everywhere.
- Linking directly to pthread/dl with conditional OS checks was wrong;
fix it to be proper cmake (linking to Threads::Threads and
${CMAKE_DL_LIBS}).
- Various cmake files erroneously listed their src directories in their
include paths.
- Made various library linkages PRIVATE instead of PUBLIC where a
transient dependency to dependent targets does not make sense.
Removes a bunch of copied code (for base32z and hex) and boost::detail
code calls (for base64).
Also includes some additional validity checks on base64 decoding that
didn't properly validate that the input is actually base64 or of the
correct length, then used an unsafe memory copy from the
unchecked-length decoded string.