title: How to correctly add resources to a project?
body: <p>I have a project organized as follows:</p>
  
  <ul>
  <li><code>include/</code></li>
  <li><code>src/</code></li>
  <li><code>share/myprogram/</code></li>
  </ul>
  
  <p>where <code>share/myprogram/</code> contains resources.
  My program is accessing these resources using relative paths. The executable expects to find them in <code>../share/myprogram/</code>.</p>
  
  <p>I would like when I run:</p>
  
  <pre><code>mkdir build
  cd build
  cmake ..
  make
  </code></pre>
  
  <p>to have the following to happen:</p>
  
  <ul>
  <li>make a <code>bin</code> directory</li>
  <li>compile and put the executable in <code>bin/</code></li>
  <li>copy the <code>share</code> directory in the <code>build</code> directory</li>
  </ul>
  
  <p><strong>I am looking for a clean way of doing this. Ideally, I would like CMake to be <em>aware</em> of the resources <em>as resources</em>.</strong><br>
  I know that I could use a copy custom command. Is this the only way to achieve this?</p>
  
  <h3>Bonus</h3>
  
  <p>If the resources could appear under <em>Resources</em> in Xcode when using the Xcode generator, and the copy be a clean copy phase under the mybin target, that would be awesome (and that's what I mean by CMake being aware of the resources <em>as resources</em>.)</p>
  
  <hr>
  
  <h3>Update:</h3>
  
  <p>What I have thus far:</p>
  
  <pre><code>set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
  add_executable(mybin ${Headers} ${Sources})
  
  add_custom_target(
      Resources ALL
      ${CMAKE_COMMAND} -E copy_directory ${PROJECT_SOURCE_DIR}/share ${PROJECT_BINARY_DIR}/share
      SOURCES ${Resources}
  )
  </code></pre>