What's the cmake generator for Visual Studio 2019

locke14 picture locke14 · Apr 16, 2019 · Viewed 10.7k times · Source

With Visual Studio 2017, I used the generator "Visual Studio 15 2017 Win64" for cmake. After updating to Visual Studio 2019, what's the new corresponding generator?

Answer

Amaresh picture Amaresh · Apr 27, 2019

from your directory where the cmakelist.txt exists. here are steps:

  1. mkdir build
  2. cd build
  3. depending upon the architecture you're using
    cmake -G "Visual Studio 16 2019" -A x64 ../"

other options are:

cmake -G "Visual Studio 16 2019" -A Win32
cmake -G "Visual Studio 16 2019" -A x64
cmake -G "Visual Studio 16 2019" -A ARM
cmake -G "Visual Studio 16 2019" -A ARM64

it will generate makefiles required and serves your purpose

furthermore, you could

devenv <nameof solutions file> /build <Debug/Release option> 

for building your project