I'm trying to learn CMake so I started with the tutorial on their website. Some functioniality like versioning with .h.in files I couldn't get to work in Visual Studio so I decided to just use CMD and CMake. Due to VS being installed CMake defaulted to creating a VS solution, after uninstalling VS it now defaults to NMake Makefiles. I want to use the MinGW generator. I know I can pass this by using the -G flag but I would like to make this to CMake's default behavior.
So that:
cmake .
would behave the same as cmake -G "MinGW Makefiles" .
I've tried the solution suggested here but it seems to not work. Setting default compiler in CMake
Maybe I set the environtment variable wrong I don't know. Here is how I proceeded:
- open CMake GUI
- open the Environment Tab
- add new Entry
- set name to CMAKE_GENERATOR
- set value to MinGW Makefiles
- press OK
But still if I create a new project and run CMake it still defaults to the NMake generator. Do you have any suggestions.