Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing current cmake generator

Tags:

How can I change current cmake generator without using Cmake GUI (I want to change standart generator to Visual Studio 12 2013 Win64)?

like image 614
VeLKerr Avatar asked Sep 14 '15 16:09

VeLKerr


People also ask

What are generator expressions in CMake?

Introduction. Generator expressions are evaluated during build system generation to produce information specific to each build configuration.

How do I open CMake GUI?

Run cmake-gui.exe, which should be in your Start menu under Program Files, there may also be a shortcut on your desktop, or if you built from source, it will be in the build directory. A GUI will appear similar to what is shown below. The top two entries are the source code and binary directories.

Does Visual Studio 2019 have CMake?

In Visual Studio 2019 version 16.9 and later, Visual Studio automatically configures IntelliSense in CMake projects based on CMake variables when you use a CMake toolchain file. For more information, see Configure IntelliSense with CMake Toolchain Files.


2 Answers

Go to File->Delete Cache and then click Configure again.

like image 69
matthewpark319 Avatar answered Oct 18 '22 11:10

matthewpark319


You cannot reliably change the generator used for an output (= binary) directory once generation has already happened there once. You should start in a fresh output directory.

Once there, simply use CMake's -G command-line option:

cmake -G "Visual Studio 12 2013 Win64" 
like image 26
Angew is no longer proud of SO Avatar answered Oct 18 '22 10:10

Angew is no longer proud of SO