title: What is the correct way to include llvm library in CLion?
body: <p>I recently installed LLVM 7, and tried to include the necessary files to start a project using llvm library in CLion. 
  However, it complains that some files are not found.</p>
  
  <p>My CMakeLists.txt file has the following: </p>
  
  <pre><code>cmake_minimum_required(VERSION 3.12)
  project(TestCmake)
  set(CMAKE_CXX_STANDARD 11)
  
  link_directories(llvm/build/include/) # linked wrongly..
  include_directories(llvm/llvm/include/) #linked wrongly.
  
  set(BUILD_2 main_2)
  set(SOURCE_FILES_2
          # testing. llvm files.
          tests/codegen_tests/fac.cpp
  )
  
  add_executable(${BUILD_2} ${SOURCE_FILES_2})
  </code></pre>
  
  <p>I know the way am linking is wrong, but I don't know how to fix it.
  I let it like this, because CLion can find the defined libraries (so I can see when I call functions of the libraries that don't exist, and if it's available I get a pop-up). </p>
  
  <p>Am currently getting the following error when I run the project: </p>
  
  <pre><code>   In file included from c4/llvm/llvm/include/llvm/IR/Module.h:23:0,
                   from c4/tests/codegen_tests/fac.cpp:1:
  c4/llvm/llvm/include/llvm/IR/Attributes.h:74:38: fatal error: llvm/IR/Attributes.inc: No such file or directory
  compilation terminated.
  CMakeFiles/main_2.dir/build.make:62: recipe for target 'CMakeFiles/main_2.dir/tests/codegen_tests/fac.cpp.o' failed
  make[3]: *** [CMakeFiles/main_2.dir/tests/codegen_tests/fac.cpp.o] Error 1
  CMakeFiles/Makefile2:109: recipe for target 'CMakeFiles/main_2.dir/all' failed
  make[2]: *** [CMakeFiles/main_2.dir/all] Error 2
  CMakeFiles/Makefile2:121: recipe for target 'CMakeFiles/main_2.dir/rule' failed
  make[1]: *** [CMakeFiles/main_2.dir/rule] Error 2
  Makefile:153: recipe for target 'main_2' failed
  make: *** [main_2] Error 2
  </code></pre>
  
  <p>The project structure is shown here <a href="https://i.stack.imgur.com/wVjHS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wVjHS.png" alt="Project Structure"></a></p>
  
  <p>Any help on this, is greatly appreciated. Thanks.</p>