C++ 20 named modules are now supported in CMake 3.28 and newer when using Ninja and Visual Studio Generators (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.
One of the easiest ways to use modules: just change the #include to import and add a ; to the end of the library file. There are some differences between #includes and imports and how they are handled. #includes can be chained in multiple header files, for instance. importing modules don't seem to chain-up.