0

CMake is a build system generator supporting different build systems and environments like make, visual studio, code-blocks, eclipse-cdt, etc... To generate a project, you can use the -G option to specify the project generator.

Is there an option, are there any projects, or is it possible to write a generator that creates batch files calling cl.exe so I don't have to open visual studio every time?

MattMatt2000
  • 622
  • 6
  • 15
  • 1
    If you call `cmake --build . --target ALL_BUILD --config Debug` from the command line in the build directory you don't have to open Visual Studio. Instead the solution is built from MSBuild. – vre Jun 23 '17 at 11:32
  • @vre thx for the example! – MattMatt2000 Jun 23 '17 at 12:05
  • 2
    You may want to consider a `set(CMAKE_MAKE_PROGRAM "${CMAKE_VS_DEVENV_COMMAND}" CACHE INTERNAL "")` call before your `project()` command for newer versions of CMake (see also [here](https://stackoverflow.com/questions/41173970/msbuild-exe-has-stopped-cmake-error/41181777#41181777)). This uses `DevEnv` instead of `MSBuild` for the `--build` command for the Visual Studio generators. – Florian Jun 23 '17 at 12:32

1 Answers1

1

CMake is able to invoke the build tool (MSBuild in this case) by itself, using the --build option. See this question for more details.

Joseph Artsimovich
  • 1,499
  • 10
  • 13