title: Embed resources (eg, shader code; images) into executable/library with CMake
body: <p>I am writing an application in C++ which relies on various resources in my project. Right now, I have the relative path from the produced executable to each resource hard-coded in my sources, and that allows my program to open the files and read in the data in each resource. This works ok, but it requires that I start the executable from a specific path relative to the resources. So if I try to start my executable from anywhere else, it fails to open the files and cannot proceed.</p>
  
  <p>Is there a <em>portable</em> way to have CMake embed my resources into the executables (or libraries) such that I can simply access them in memory at runtime instead of opening files whose paths are brittle? I have found a <a href="https://stackoverflow.com/questions/2627004/embedding-binary-blobs-using-gcc-mingw">related question</a>, and it looks like embedding resources can be done well enough with some <code>ld</code> magic. So my question is how do I do this in a <em>portable, cross platform</em> manner using CMake? I actually need my application run on both x86 and ARM. I am ok with supporting only Linux (Embedded), but bonus points if anyone can suggest how to do this for Windows (Embedded) as well.</p>
  
  <p>EDIT:
  I forgot to mention a desired property of the solution. I would like to be able to use CMake to cross-compile the application when I am building for ARM rather than have to compile it natively on my ARM target.</p>