There is not an officially endorsed CMake setup for CXX, but a few developers have shared one that they got working. You can try one of these as a starting point. If you feel that you have arrived at a CMake setup that is superior to what is available in these links, feel free to make a PR adding it to this list.
- Supports cross-language link time optimization (LTO)
- Includes a cbindgen component
- Tested on Windows 10 with MSVC, and on Linux
- Alias target that can be linked into a C++ project
- Tested on Windows 10 with GNU target, and on Linux