0

I would like to use cmake to build project code, but I haven't used cmake with C++20 Modules. Currently, I'm using a hand written Makefile to build and link modules.

I'd like to see a code example of cmake building C++20 modules and linking them to an executable or shared library?

I'm building on Ubuntu v20.

James Smith
  • 817
  • 1
  • 4
  • 13
  • Do you look for a solution that somehow works e.g. setting options for the compiler manually? Or do you look for a solution for which cmake applies the correct compiler options? – t.niese Dec 08 '20 at 13:25
  • Either is fine, just want to use cmake to build the modules and link them. I can make a library or executable in cmake. If someone has already used a generic build statement or wrote a function in cmake to build modules that would be good to see. – James Smith Dec 08 '20 at 14:15
  • Then it is likely a duplicate to [How to use c++20 modules with CMake?](https://stackoverflow.com/questions/57300495). imho there is currently no other way to do it right now than shown in that answer to that question. But due to the lack of builtin support in cmake right now, it is more or less equivalent to what you already do in the make file (so not a generic solution). – t.niese Dec 08 '20 at 14:24
  • Thanks, I won't need this post. It's already been closed. – James Smith Dec 08 '20 at 16:14
  • what do you want to say with that comment? – t.niese Dec 08 '20 at 18:19
  • I appreciate your help. – James Smith Dec 09 '20 at 14:40

0 Answers0