title: CMake link files from subdirectories and parent directories
body: <p>I have a folder net like:</p>
  
  <pre><code>main
     headers
        cls1.hpp   cls2.hpp ...
     sources
        cls1.cpp   cls2.cpp ...
  resources
     r1.hpp   r2.hpp ...
  </code></pre>
  
  <p>I have tried more cmake methods to link the files, like </p>
  
  <pre><code>set(SRC ${SRC})
  </code></pre>
  
  <p>in parent dir and </p>
  
  <pre><code>set(SRC ${SRC} ${CMAKE_CURRENT_SOURCE_DIR}/cls1.cpp PARENT_SCOPE)
  </code></pre>
  
  <p>in subdir</p>
  
  <p>OR</p>
  
  <pre><code>file(GLOB_RECURSE SRC_FILES ${PROJECT_SOURCE_DIR}/*.cpp)
  file(GLOB_RECURSE HDR_FILES ${PROJECT_SOURCE_DIR}/*.hpp)
  </code></pre>
  
  <p>to get the .cpp and .hpp files, but when I do</p>
  
  <pre><code>#include "resources/r1.hpp"
  </code></pre>
  
  <p>I get error like <code>"resources/r1.hpp" No such a file or directory</code></p>
  
  <p>Can anyone help me pleas? How can I do linking between files in folders in my case?</p>