u/basvas_jkj

A small CMake helper for C++20 modules (including C++23 import std)
▲ 14 r/cmake+1 crossposts

A small CMake helper for C++20 modules (including C++23 import std)

I’ve been experimenting with C++ modules across different compilers and build systems, and ended up writing a small CMake helper script that makes the whole thing much less painful.

It doesn’t try to reinvent module support — it relies on CMake’s native named-module features and only adds a thin layer of convenience (shorter target definitions, optional header-unit helpers, and clean presets for Clang/GCC/MSVC).

If you’re playing with modules or want a minimal, practical setup without extra tooling, you might find it useful:

👉 https://github.com/basvas-jkj/cpp_modules

It includes example programs, compiler compatibility notes, and a summary of what actually works in practice on Windows/Linux.

If you want to see larger example, you can check my older project, fully rewritten to use C++ modules:

👉 https://github.com/basvas-jkj/oul

u/basvas_jkj — 5 days ago