Setting up Cmder

February 2, 2018 in Notes

Here are some general notes to remind me how to setup cmder with msvc and ninja to compile from the command line.

Things you will need:

  • cmder
  • Ninja
  • Microsoft Visual Studio 20XX
  • CMake

Setting up environment for Windows

The key is to setup the environment on Windows, there is a script for this that comes with your Visual Studio install known as vcvarsall.bat. You can add this to the startup options in cmder as the below command.

cmd /k ""%VS140COMNTOOLS%\..\..\VC\vcvarsall.bat" x64 && "%ConEmuDir%\..\init.bat"" -new_console:d:%USERPROFILE%

As you can see above, there is an x64 just after the vcvarsall.bat, as you might have guessed this specifies 64-bit builds. Remove this for 32-bit builds!

Visual Studio 2017 has changed the directory and the naming scheme for the environment variables are slightly different. I’ve not worked out what they are yet but you can find vcvarsall.bat here "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall"

It’s as simple as that! Now hopefully I’ll never forget this and can refer to this post.

Using CMake and ninja going forward is as simple as specifying as the generator with -G.

cmake -G Ninja ..
Thanks for reading! Let me know what you think of this article on twitter @7thsanctum or leave a comment below!
comments powered by Disqus

who am i

what is this

This is my blog where I post occasional updates on projects I'm working on and other things I am getting up to.

© MMXVIII by Mark M. Miller.
Papyrus theme by Hugo Sereno Ferreira.