title: How to add include rule for other directory?
body: <p>I have this directory structure :</p>
  
  <pre><code>- code
    - shared lib 1
      - unit tests
    - shared lib 2
      - unit tests
  - extern libs
    - gtest + gmock
    - extern lib
  </code></pre>
  
  <p>Each directory has one CMakeLists.txt file.</p>
  
  <p>Shared library 2 needs to link shared library 2. This I solved, how to solve the include?</p>
  
  <p>Here are my CMakeList.txt files for shared lib 1 :</p>
  
  <pre><code>SET( LIB_OUTPUT_NAME shlib1 )
  
  FILE (GLOB HEADER_FILES ./*.hpp)
  FILE (GLOB SOURCE_FILES ./*.cpp)
  
  ADD_LIBRARY (${LIB_OUTPUT_NAME} SHARED ${SOURCE_FILES} ${HEADER_FILES} )
  </code></pre>
  
  <p>and for shared lib 2 :</p>
  
  <pre><code>SET( LIB_OUTPUT_NAME shlib2 )
  
  # what to put here? this doesn't work
  include_directories(${shlib1})
  
  FILE( GLOB HEADER_FILES ./*.hpp )
  FILE( GLOB SOURCE_FILES ./*.cpp )
  
  ADD_LIBRARY( ${LIB_OUTPUT_NAME} SHARED ${SOURCE_FILES} ${HEADER_FILES} )
  
  target_link_libraries( ${LIB_OUTPUT_NAME} shlib1 ) 
  </code></pre>
  
  <p>PS: I got more libraries - not just 2. That is why I am looking at more generic solution.</p>
  
  <hr>
  
  <p>I tried to use <a href="http://www.cmake.org/cmake/help/v2.8.12/cmake.html#command%3atarget_include_directories">target_include_directories</a> like this :</p>
  
  <pre><code>target_include_directories( ${LIB_OUTPUT_NAME} PUBLIC ${shlib1} )
  </code></pre>
  
  <p>but it didn't work.</p>