title: How to best handle data files with CMake?
body: <p>I've got a CMake project that contains code and a few data files (images to be precise).</p>
  
  <p>My directory structure is like this:</p>
  
  <ul>
  <li>src</li>
  <li>data</li>
  </ul>
  
  <p>src contains the source code, data the data files. CMake suggests out of source builds, so when I invoke <em>make</em>, I have the executable program, but not the data files, thus I cannot execute the program.</p>
  
  <p>Of course, <em>make install</em> would copy my data files to the required location and make it work, therefore I develop like this right now:</p>
  
  <ol>
  <li>cmake -DCMAKE_INSTALL_DIR=dist</li>
  <li><code>&lt;edit source code&gt;</code></li>
  <li>make install</li>
  <li>dist/myprogram.exe</li>
  </ol>
  
  <p>That's okay if I'm working with the command line and an editor, but I recently decided to move to Eclipse CDT. Generating an Eclipse project from CMake works great, but manually executing the <em>install</em> target from Eclipse is not so nice.</p>
  
  <p>How do you people tackle this problem? Does your program have some clever algorithms to try and find its data directory even if it's not where the binary is? Or do you not use out of source builds?</p>