title: Library headers not visible in headers but perfectly visible inside .cpp file under cmake build. Why?
body: <p>I have a C++ project containing several modules, some built as libraries, with such structure:</p>
  
  <pre><code>/MyProject
   +---/build 
       /ModuleA 
        +---CMakeLists.txt        &lt;- module level CMakeLists
        +---/src
        |     +--CMakeLists.txt   &lt;- src level CMakeLists
        |     +--FileA1.cpp
        |     +--FileA2.cpp
        +---/include
        |     +--FileA1.h
        |     +--FileA2.h
        |     +--FileA3.h
        /ModuleB
        +---CMakeLists.txt
        +---/src
        |     +--CMakeLists.txt
        |     +--FileB1.cpp
        |     +--FileB2.cpp
        +---/include
        |     +--FileB1.h
        |     +--FileB2.h
        |     +--FileB3.h
        main.cpp
        CMakeLists.txt            &lt;- project level CMakeLists
  </code></pre>
  
  <p>CMakeLists.txt files look as follow:</p>
  
  <p>project level:</p>
  
  <pre><code>cmake_minimum_required(VERSION 3.05)
  project(MyProject)
  subdirs(ModuleA ModuleB)   
  set(CMAKE_CXX_STANDARD 11) 
  add_executable(MyProject main.cpp)
  target_link_libraries(MyProject ModuleA ModuleB)
  </code></pre>
  
  <p>module level:</p>
  
  <pre><code>subdirs(src)
  </code></pre>
  
  <p>src level:</p>
  
  <pre><code>FIND_PACKAGE(SomePackage REQUIRED) 
  INCLUDE_DIRECTORIES(
          ${SomePackage_INCLUDE_DIR}
          ${MyProject_SOURCE_DIR}/ModuleA/include
  )       
  SET(SOURCE_FILES &lt;all files from ModuleA/src goes here&gt;)
  ADD_LIBRARY(ModuleA STATIC ${SOURCE_FILES})
  TARGET_LINK_LIBRARIES(ModuleA
          ${SomePackage_LIBRARIES}
  )
  </code></pre>
  
  <p>The problem is: when I include header files from 'SomePackage' in my ModuleA header files (i.e. SomePackageFile.hpp in FileA1.h) I get an error while running a build with make:</p>
  
  <p>fatal error: SomePackageFile.hpp: No such file or directory</p>
  
  <p>When I include them in cpp files they are visible and project compiles correctly. I assume that is sth wrong with CMakeLists on src level or entire hierarchy of files is missing something.</p>