title: How do I include header files from /usr/include in my cmake project?
body: <p>I have been scouring similar, existing Stack Overflow questions, but I am still clueless (this is my first time using cmake). I simply want to include headers that lie in subdirectories of /usr/include in my cmake project, but I obviously have no idea what I am doing :-) I am using the Bash shell and vim because I am cool like Mick Jagger. </p>
  
  <p>Here is my CMakeLists.txt:</p>
  
  <pre><code>cmake_minimum_required (VERSION 2.8)
  
  project (VoxelRPG)
  
  set (VoxelRPG_VERSION_MAJOR 0)
  set (VoxelRPG_VERSION_MINOR 1)
  
  configure_file (
          "${PROJECT_SOURCE_DIR}/src/VoxelRPG.h.in"
          "${PROJECT_SOURCE_DIR}/src/VoxelRPG.h"
  )
  
  subdirs(src)
  
  include_directories("/usr/include" "/usr/include/GL" "/usr/include/glm" "/usr/include/glm/gtc" "${PROJECT_SOURCE_DIR}/src")
  
  set(HEADER_FILES "/usr/include/GL/glew.h" "/usr/include/GL/glfw.h" "/usr/include/glm/glm.hpp" "/usr/include/glm/gtc/matrix_transform.hpp")
  
  add_executable(voxel_rpg src/main.cpp ${HEADER_FILES})
  </code></pre>
  
  <p>The CMakeLists.txt in the src directory is one line:</p>
  
  <pre><code>cmake_minimum_required (VERSION 2.8)
  </code></pre>
  
  <p>Here is the head of main.cpp (it shows the headers I want to use):</p>
  
  <pre><code>// Include GLEW
  #include &lt;GL/glew.h&gt;
  
  // Include GLFW
  #include &lt;GL/glfw.h&gt;
  
  // Include GLM
  #include &lt;glm/glm.hpp&gt;
  #include &lt;glm/gtc/matrix_transform.hpp&gt;
  using namespace glm;
  
  #include "shader.hpp"
  #include "texture.hpp"
  </code></pre>
  
  <p>The cmake operation does not throw an error:</p>
  
  <pre><code>chris@stupid:~/voxel_rpg$ cmake .
  -- Configuring done
  -- Generating done
  -- Build files have been written to: /home/chris/voxel_rpg
  </code></pre>
  
  <p>However, the make operation spits out this error message:</p>
  
  <pre><code>chris@stupid:~/voxel_rpg$ make
  Linking CXX executable voxel_rpg
  CMakeFiles/voxel_rpg.dir/src/main.cpp.o: In function `main':
  main.cpp:(.text+0x16): undefined reference to `glfwInit'
  main.cpp:(.text+0x62): undefined reference to `glfwOpenWindowHint'
  main.cpp:(.text+0x76): undefined reference to `glfwOpenWindowHint'
  main.cpp:(.text+0x8a): undefined reference to `glfwOpenWindowHint'
  main.cpp:(.text+0x9e): undefined reference to `glfwOpenWindowHint'
  main.cpp:(.text+0xea): undefined reference to `glfwOpenWindow'
  main.cpp:(.text+0x11d): undefined reference to `glfwTerminate'
  main.cpp:(.text+0x12d): undefined reference to `glewExperimental'
  main.cpp:(.text+0x133): undefined reference to `glewInit'
  main.cpp:(.text+0x177): undefined reference to `glfwSetWindowTitle'
  main.cpp:(.text+0x183): undefined reference to `glfwEnable'
  main.cpp:(.text+0x1ab): undefined reference to `glClearColor'
  main.cpp:(.text+0x1b7): undefined reference to `glEnable'
  main.cpp:(.text+0x1c3): undefined reference to `glDepthFunc'
  main.cpp:(.text+0x1c8): undefined reference to `__glewGenVertexArrays'
  main.cpp:(.text+0x1e0): undefined reference to `__glewBindVertexArray'
  main.cpp:(.text+0x1ff): undefined reference to `LoadShaders(char const*, char const*)'
  main.cpp:(.text+0x20a): undefined reference to `__glewGetUniformLocation'
  main.cpp:(.text+0x408): undefined reference to `loadDDS(char const*)'
  main.cpp:(.text+0x413): undefined reference to `__glewGetUniformLocation'
  main.cpp:(.text+0x431): undefined reference to `__glewGenBuffers'
  main.cpp:(.text+0x449): undefined reference to `__glewBindBuffer'
  main.cpp:(.text+0x461): undefined reference to `__glewBufferData'
  main.cpp:(.text+0x487): undefined reference to `__glewGenBuffers'
  main.cpp:(.text+0x49f): undefined reference to `__glewBindBuffer'
  main.cpp:(.text+0x4b7): undefined reference to `__glewBufferData'
  main.cpp:(.text+0x4e4): undefined reference to `glClear'
  main.cpp:(.text+0x4e9): undefined reference to `__glewUseProgram'
  main.cpp:(.text+0x4fa): undefined reference to `__glewUniformMatrix4fv'
  main.cpp:(.text+0x546): undefined reference to `__glewActiveTexture'
  main.cpp:(.text+0x565): undefined reference to `glBindTexture'
  main.cpp:(.text+0x56a): undefined reference to `__glewUniform1i'
  main.cpp:(.text+0x582): undefined reference to `__glewEnableVertexAttribArray'
  main.cpp:(.text+0x590): undefined reference to `__glewBindBuffer'
  main.cpp:(.text+0x5a8): undefined reference to `__glewVertexAttribPointer'
  main.cpp:(.text+0x5de): undefined reference to `__glewEnableVertexAttribArray'
  main.cpp:(.text+0x5ec): undefined reference to `__glewBindBuffer'
  main.cpp:(.text+0x604): undefined reference to `__glewVertexAttribPointer'
  main.cpp:(.text+0x651): undefined reference to `glDrawArrays'
  main.cpp:(.text+0x656): undefined reference to `__glewDisableVertexAttribArray'
  main.cpp:(.text+0x664): undefined reference to `__glewDisableVertexAttribArray'
  main.cpp:(.text+0x672): undefined reference to `glfwSwapBuffers'
  main.cpp:(.text+0x67e): undefined reference to `glfwGetKey'
  main.cpp:(.text+0x68f): undefined reference to `glfwGetWindowParam'
  main.cpp:(.text+0x6ac): undefined reference to `__glewDeleteBuffers'
  main.cpp:(.text+0x6c4): undefined reference to `__glewDeleteBuffers'
  main.cpp:(.text+0x6dc): undefined reference to `__glewDeleteProgram'
  main.cpp:(.text+0x6fd): undefined reference to `glDeleteTextures'
  main.cpp:(.text+0x702): undefined reference to `__glewDeleteVertexArrays'
  main.cpp:(.text+0x71a): undefined reference to `glfwTerminate'
  collect2: error: ld returned 1 exit status
  make[2]: *** [voxel_rpg] Error 1
  make[1]: *** [CMakeFiles/voxel_rpg.dir/all] Error 2
  make: *** [all] Error 2
  </code></pre>
  
  <p>Thanks in advance to the awesome people who help me!</p>