title: Creating and using a static library with CMake
body: <p>I am trying to first create a static library and then link it to an executable using CMake. My project file structure looks like this:</p>
  
  <pre><code>├── CMakeLists.txt
  ├── build
  ├── lib
  │   ├── CMakeLists.txt
  │   ├── build
  │   ├── include
  │   │   └── Point.hpp
  │   └── src
  │       └── Point.cpp
  └── mainApp.cpp
  </code></pre>
  
  <p>I first build the library like so.</p>
  
  <pre><code>cmake_minimum_required(VERSION 2.8.9)
  project(CAST3)
  set(CMAKE_BUILD_TYPE Release)
  
  include_directories(include)
  
  file(GLOB SOURCES "src/*.cpp")
  add_library(CAST3 STATIC ${SOURCES})
  </code></pre>
  
  <p>However, when i try to link the library to my executable I get an error.</p>
  
  <p>This is my executable</p>
  
  <pre><code>#include"Point.hpp"
  int main(int argc, char *argv[]){
      Point p = Point(1,2,3);
      return 0;
  }
  </code></pre>
  
  <p>This is my CMake file to link the library to the executable.</p>
  
  <pre><code>cmake_minimum_required(VERSION 2.8.9)
  project (CAST3)
  set ( PROJECT_LINK_LIBS libCAST3.a )
  link_directories( ${CMAKE_CURRENT_SOURCE_DIR}/lib/build)
  add_executable(libtest mainApp.cpp)
  target_link_libraries(libtest ${PROJECT_LINK_LIBS} )
  </code></pre>
  
  <p>When I run that I get the this error</p>
  
  <pre><code>/mainApp.cpp:1:9: fatal error: 'Point.hpp' file not found
  #include"Point.hpp"
          ^~~~~~~~~~~
  1 error generated.
  make[2]: *** [CMakeFiles/libtest.dir/mainApp.cpp.o] Error 1
  make[1]: *** [CMakeFiles/libtest.dir/all] Error 2
  make: *** [all] Error 2
  </code></pre>
  
  <p>What am I missing?</p>