title: How to include another cmake project's header files in my cmake project?
body: <p>I'm trying to include another CMake project as a third party library for my project. The problem is that I can't include the headers from the said library.</p>
  
  <p>I tried adding the library using <code>add_subdirectory</code> function but it doesn't seem to work.</p>
  
  <p>This is my CMakeLists.txt: </p>
  
  <pre><code>cmake_minimum_required (VERSION 2.6)
  project (Cam2ClientCpp)
  
  set(CMAKE_VERBOSE_MAKEFILE ON)
  set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
  
  include_directories ("${PROJECT_SOURCE_DIR}/restclient-cpp")
  add_subdirectory (restclient-cpp)
  
  set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
  set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
  
  add_executable (Cam2ClientCpp main.cpp)
  target_link_libraries (Cam2ClientCpp restclient-cpp)
  </code></pre>
  
  <p>The other project's CMakeLists.txt is here: <a href="https://github.com/mrtazz/restclient-cpp/blob/master/CMakeLists.txt" rel="nofollow noreferrer">https://github.com/mrtazz/restclient-cpp/blob/master/CMakeLists.txt</a>.</p>
  
  <p>When I run make, I get the following error: </p>
  
  <pre><code>/Library/Developer/CommandLineTools/usr/bin/c++   -I/Users/nhendy/Development/cam2clientcpp/restclient-cpp  -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk   -std=gnu++11 -o CMakeFiles/Cam2ClientCpp.dir/main.cpp.o -c /Users/nhendy/Development/cam2clientcpp/main.cpp
  /Users/nhendy/Development/cam2clientcpp/main.cpp:1:10: fatal error: 'restclient-cpp/connection.h' file not found
  #include "restclient-cpp/connection.h"
  </code></pre>