title: Clang with cmake. target_include_directories "No such file or directory"
body: <p>Here is my c++ project.</p>
  
  <pre><code>├── CMakeLists.txt
  ├── include
  │   └── ccli
          └──  # headers
  ├── src
  │   ├── CMakeLists.txt
  │   ├── exec_expr.cpp
  │   ├── GlobalContext.cpp
  │   ├── main.cpp
      └──  # others
  </code></pre>
  
  <p>/CMakeLists.txt:</p>
  
  <pre><code>cmake_minimum_required(VERSION 3.5)                                                                  
  
  project(main)                                                                                        
  
  set(CMAKE_CXX_FLAGS "-Wall -std=c++17")                                                              
  
  find_package(LLVM REQUIRED CONFIG)                                                                   
  message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION} in ${LLVM_INSTALL_PREFIX}")                       
  message(STATUS "Using LLVMConfig.cmake in ${LLVM_DIR}")                                              
  
  find_package(Clang REQUIRED CONFIG HINTS "{LLVM_INSTALL_PREFIX}/lib/cmake/clang")                    
  message(STATUS "Found Clang in ${CLANG_INSTALL_PREFIX}")                                             
  message(STATUS "Found Cland headers in ${CLANG_INCLUDE_DIRS}")                                       
  message(STATUS "Found LLVM headers in ${LLVM_INCLUDE_DIRS}")                                         
  
  add_subdirectory(src)                                                                                
  
  add_executable(                                                                                      
      main                                                                                             
          src/main.cpp                                                                                 
  )                                                                                                    
  
  target_include_directories(main PRIVATE ${LLVM_INCLUDE_DIRS})                                        
  target_include_directories(                                                                          
      main PUBLIC                                                                                      
          ${PROJECT_SOURCE_DIR}/include                                                                
  )                                                                                                    
  
  # Fixes clang linking error.                                                                         
  target_compile_definitions(main PUBLIC -DLLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING)                 
  target_link_libraries(main ccli readline)  
  </code></pre>
  
  <p>/src/CMakeLists.txt:</p>
  
  <pre><code>cmake_minimum_required (VERSION 3.5)                             
  
  add_library(                                                     
      ccli STATIC                                                  
          exec_expr.cpp                                            
          runToolOnCode.cpp                                        
          GlobalContext.cpp                                        
          Utility.cpp                                              
  )                                                                
  
  target_include_directories(ccli PRIVATE "${LLVM_INCLUDE_DIR}")   
  target_include_directories(                                      
      ccli PRIVATE                                                 
          ${PROJECT_SOURCE_DIR}/include                            
  )                                                                
  
  target_link_libraries(                                           
      ccli PRIVATE                                                 
          clangTooling                                             
          clangFrontend                                            
          clangStaticAnalyzerFrontend                              
  )                                                                
  </code></pre>
  
  <p>top of src/main.cpp:</p>
  
  <pre class="lang-cpp prettyprint-override"><code>#include "ccli/runToolOnCode.hpp"          
  #include "ccli/GlobalContext.hpp"          
  #include "ccli/exec_expr.hpp"              
  #include "ccli/Utility.hpp"                
  
  #include "clang/Frontend/FrontedActions.h"  //&lt;- error occures here                                   
  </code></pre>
  
  <p>Problem is all files used in add_library() can include and use clang headers, but main.cpp cannot.
  Also I don't understand why main.cpp is allowed to include 
  /include/ccli headers, as I understand, it means that this code works well:</p>
  
  <pre><code>target_include_directories(                                                                          
      main PUBLIC                                                                                      
          ${PROJECT_SOURCE_DIR}/include                                                                
  )
  </code></pre>
  
  <p>But this not?:</p>
  
  <pre><code>target_include_directories(main PRIVATE ${LLVM_INCLUDE_DIRS})
  </code></pre>
  
  <p>And finally
  Output of cmake .</p>
  
  <pre><code>-- Found LLVM 8.0.0 in /usr/lib/llvm-8
  -- Using LLVMConfig.cmake in /usr/lib/llvm-8/cmake
  -- Found Clang in /usr/lib/llvm-8
  -- Found Cland headers in /usr/lib/llvm-8/include
  -- Found LLVM headers in /usr/lib/llvm-8/include
  -- Configuring done
  -- Generating done
  -- Build files have been written to: /c_repl/build
  </code></pre>
  
  <p>Output of make</p>
  
  <pre><code>/c_repl/src/main.cpp:6:10: fatal error: clang/Frontend/FrontedActions.h: No such file or directory
   #include "clang/Frontend/FrontedActions.h"
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  compilation terminated.
  CMakeFiles/main.dir/build.make:62: recipe for target 'CMakeFiles/main.dir/src/main.cpp.o' failed
  make[2]: *** [CMakeFiles/main.dir/src/main.cpp.o] Error 1
  CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/main.dir/all' failed
  make[1]: *** [CMakeFiles/main.dir/all] Error 2
  Makefile:83: recipe for target 'all' failed
  make: *** [all] Error 2
  </code></pre>
  
  <p>Any help or tips would be appreciated. Thanks.
  PS Working on linux</p>
  
  <pre><code>Distributor ID: Ubuntu
  Description:    Ubuntu 18.04.3 LTS
  Release:        18.04
  Codename:       bionic
  </code></pre>
  
  <p>PPS: 
  Sorry for my bad english</p>