CMake executable minimal example

This CMakeLists.txt builds an executable called main from main.cpp:

CMakeLists.txt
add_executable(main main.cpp)

Check out similar posts by category: CMake