Bundle and use fmt in CMake code
In !3771 (closed) we can see a refactoring of std::ostringstream
usage.
We can improve the CMake's code performance, while preserving the type safety by using fmt.
About fmt
:
- {fmt} is an open-source formatting library for C++. It can be used as a safe and fast alternative to (s)printf and iostreams.
- Has an MIT license
- Requires only C++11
- Implementation of C++20 std::format.
https://fmt.dev/latest/usage.html#building has the information about building the library, which is as hard/simple as:
To use the {fmt} library, add fmt/core.h, fmt/format.h, fmt/format-inl.h, src/format.cc and optionally other headers from a release archive or the Git repository to your project. Alternatively, you can build the library with CMake.
Socializing with {fmt} - Daniela Engert - Meeting C++ 2018
Edited by Cristian Adam