Experiments with Modern C++ -- Todo
- Install CMake via setup with path addition
- Install MinGW and add to path
- create CMakeLists.txt with necessary configuration settings
CMake Windows uses Visual Studio Compiler by default. You need to explicitly set gcc compiler if required.
...Basic configuration as below
cmake_minimum_required(VERSION 3.13) set(CMAKE_CXX_COMPILER "C:/MinGW/bin/g++") project(program) add_executable(program main.cpp)
- run cmake . generate a makefile from current working directory
...
$ cmake .
- run make to create the executable file
...
$ make
- run your program
...
$ ./program