title: configuring emacs for cmake
body: <p>gcc 4.4.2
  cmake 2.6</p>
  
  <p>I have just started using cmake. Coming from writing my own Makefiles.</p>
  
  <p>However, I have this directory structure and using out-of-source build. To separate the source files from the build files.</p>
  
  <pre><code>project
      src
          my_c_files.c
          CMakeLists.txt
      build
          Makefile
  </code></pre>
  
  <p>Before I would write my own Makefiles in the src directory and then press F5 and I was able to compile my program. And emacs would list any warning or errors. However, it seems that I have to open a terminal and go to the build directory to run </p>
  
  <pre><code>cmake ../src
  </code></pre>
  
  <p>and then </p>
  
  <pre><code>make
  </code></pre>
  
  <p>I would like to run make from within emacs the same as pressing F5. But as the Makefile as been generated in the build directory, and emacs is looking for it in the src directory.</p>
  
  <p>Even when I set a soft link to the Makefile in the src directory to link to the Makefile in the build directory. All this did was give me a list of errors.</p>