| description | Build C++ projects with CMake |
|---|
Build the project using CMake presets.
- Check for CMake presets:
cmake --list-presets- If presets exist, use them:
cmake --preset <preset-name>
cmake --build --preset <preset-name>- If no presets, use standard out-of-source build:
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build- For specific compilers:
| Compiler | CMake Generator |
|---|---|
| MSVC | -G "Visual Studio 17 2022" |
| GCC | -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ |
| Clang | -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ |
Build artifacts will be in the build/ directory (or as specified by presets).
Based on Vinnie Falco's build command from cppalliance/coro-io-context