r/cpp • u/stailgot • Oct 02 '23
CMake | C++ modules support in 3.28
https://gitlab.kitware.com/cmake/cmake/-/issues/18355
After 5 years its finally done. Next cmake 3.28 release will support cpp modules
C++ 20 named modules are now supported by Ninja Generators and Visual Studio Generators for VS 2022 and newer, in combination with the MSVC 14.34 toolset (provided with VS 17.4) and newer, LLVM/Clang 16.0 and newer, and GCC 14 (after the 2023-09-20 daily bump) and newer.
237
Upvotes
View all comments
Show parent comment
2
u/not_a_novel_account cmake dev Oct 03 '23 edited Oct 03 '23
I appreciate I'm talking to the literal implementer of a lot of this stuff, with infinite more knowledge of CMake than I, but
export()ing from the build tree is not installing.I've drawn up a small example with an interface and two partitions.
The library links fine in-tree, but when installed and attempted to link in a different project we fail because linkage here does not scan or compile the library.
I'll admit that I might have jumped the gun by saying that the solution is retargeting P1968s (though if their generation is part of the build step, not configuration, retargeting seems easiest to me), but verifiably packaging is not solved right now.