target_compile_features Library features (particularly C++17)
This is maybe half a discussion and only half an issue report. This table: https://cmake.org/cmake/help/git-master/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.html#prop_gbl:CMAKE_CXX_KNOWN_FEATURES mostly (if not exclusively) contains C++ core language features, as opposed to standard library features.
C++17 brought many new awesome library features, like for example <optional>
or <filesystem>
. The compiler support for them is at the moment a bit mixed, but improving. In light of that it would be particularly good to be able to query these features from CMake as well, in the same way as for compiler features, so for example specify that a project needs cxx_optional
.
I realise it might be a tiny bit more complicated than for core language features because the core language features are tied to the compiler, while the standard library may not necessarily be - for example clang can use libstdc++ as well as libc++, and the library features they offer would differ.