title: How to use relative paths to open files in source code in CMake generated solution
body: <p>I am using CMake to generate one executable and several libraries. I have specified the output folder of the executable and all libraries to a common "bin" folder.</p>
  
  <p>Using: </p>
  
  <pre><code>set_target_properties (${PROJ} 
     PROPERTIES
     ARCHIVE_OUTPUT_DIRECTORY_DEBUG "${BIN_DIR}"
     ARCHIVE_OUTPUT_DIRECTORY_RELEASE "${BIN_DIR}"
     RUNTIME_OUTPUT_DIRECTORY_DEBUG "${BIN_DIR}"
     RUNTIME_OUTPUT_DIRECTORY_RELEASE "${BIN_DIR}"
     LIBRARY_OUTPUT_DIRECTORY_DEBUG "${BIN_DIR}"
     LIBRARY_OUTPUT_DIRECTORY_RELEASE "${BIN_DIR}"
  )
  </code></pre>
  
  <p>In one of the libraries, I am opening a resource file using a relative path. This path is relative to the "bin" folder <code>.//Resources//file.jpg</code> (as the Resources folder is IN the bin folder). </p>
  
  <p>When I run the exe from the visual studio debugger, I see that it correctly runs the exe from the bin folder but when it tries to open file.jpg, it looks in the path relative to <code>CMAKE_BINARY_DIR</code>. So, <code>CMAKE_BINARY_DIR/Resources/file.jpg</code>. So, I get a run-time error saying file not found. </p>
  
  <p>What is the best way to get around this? I don't want to copy all the resources in the <code>CMAKE_BINARY_DIR</code>. Seems like there should be better way.  </p>
  
  <p>Thanks for any help in advance. </p>