cmakevisual-studio-2019

Configure CMake version in Visual Studio 2019


Is there a way to configure the Visual Studio 2019 integrated CMake version? There are features in the latest CMake version that I would like to use, but I'm forced to build from the command line in this case. If I build from the VS IDE, the CMake version used is the Visual Studio-integrated one. I would like to change it if possible.


Solution

  • You can download the latest CMake from here to your system. To point Visual Studio to this latest version, you have to edit your CMakeSettings.json file. You must change the value of the cmakeExecutable option to the installed location of the latest CMake version.

    CMakeSettings.json:

      ...
      "cmakeExecutable": "C:/path/to/new/cmake/executable",
      ...
    

    If you followed:

    Then CMakeSettings.json should appear directly in your solution explorer window:

    enter image description here