title: cmake command line option
body: <p>I am new to VS development and Cmake. 
  I have used CMake-GUI to generate a visual studio solution and am able to build it successfully.</p>
  
  <p>However, our code has now reached a stage where we can finally build &amp; link into a binary. With multiple people checking in code, we want to do a nightly build and so I was thinking of writing a batch file for this.</p>
  
  <p>However, I am trying to invoke cmake from command line and am running into issues.</p>
  
  <p>In cmake-gui, in order to configure, I provide two values
  Path of my source code
  Path where binaries will be generated</p>
  
  <p>However, when I try to run the same over command line (using the following command)</p>
  
  <pre><code>cmake -G "NMake Makefiles" -D CMAKE_SOURCE_DIR="D:\source_code" -D CMAKE_BINARY_DIR="D:\source_code\build\gen\host"
  </code></pre>
  
  <p>CMake throws up an eror : The source directory "D:\" is a file not a directory.</p>
  
  <p>I tried the following variations too without any luck </p>
  
  <pre><code>cmake -G "NMake Makefiles" -D PROJECT_SOURCE_DIR="D:\source_code" -D PROJECT_BINARY_DIR="D:\source_code\build\gen
  </code></pre>
  
  <p>Can someone please guide me to the correct syntax.</p>
  
  <p>Thanks in advance</p>