title: How to set include_directories from a CMakeLists.txt file?
body: <p>I seem to be having trouble setting the include path (<code>-I</code>) using the <code>include_directories()</code> command in CMake. My project directory is as follows:</p>
  
  <pre><code>Root
  | - CMakeLists.txt
  | - libs
  | - | - CMakeLists.txt
  | - | - inc
  | - | - | - // lib specific includes
  | - | - src
  | - | - | - // lib specific sources
  | - proj1
  | - | - CMakeLists.txt
  | - | - inc
  | - | - | - // proj1 specific includes
  | - | - src
  | - | - | - // proj1 specific sources
  </code></pre>
  
  <p>The root <code>CMakeLists.txt</code> file looks like so:</p>
  
  <pre><code>project(ROOT)
  add_subdirectory(libs)
  add_subdirectory(proj1)
  </code></pre>
  
  <p>The <code>CMakeLists.txt</code> file under <code>libs</code>:</p>
  
  <pre><code>project(lib)
  add_library(lib STATIC ${lib_hdrs} ${lib_srcs}) // for conciseness, omitted set() 
  </code></pre>
  
  <p>And lastly, the <code>CMakeLists.txt</code> file under <code>proj1</code>:</p>
  
  <pre><code>project(proj1)
  
  include_directories("${ROOT_SOURCE_DIR}/lib/inc") # &lt;- problem line?
  
  add_executable(proj1 ${proj1_srcs})
  target_link_libraries(proj1 lib)
  </code></pre>
  
  <p>The goal is to create the library from the source and header files in libs, then link against the executable generated under proj1. Proj1 has some files that <code>#include</code> stuff in libs include, so I need to add the directories to be used with <code>-I</code>. Based on the documentation, that's what <code>include_directories()</code> is supposed to do. However despite explicitly setting that and following it with a debug <code>message(${INCLUDE_DIRECTORIES})</code>, the <code>INCLUDE_DIRECTORIES</code> variable is an empty string, and no directories are specified for the include path, so my compilation of proj1 fails. </p>
  
  <p>I've also attempted removing the quotes around <code>${ROOT_SOURCE_DIR}/inc</code> to see if that helped but no luck. </p>