title: Linking GLEW with CMake
body: <p>How can you link GLEW to a project with CMake?</p>
  
  <p>We've been trying to link GLEW to our project using CMake for at least 3 hours without any success so any help is accepted. </p>
  
  <p>I'm using the FindGLEW.cmake which comes with CMake 3.1.0</p>
  
  <p><strong>CMakeLists.txt</strong></p>
  
  <pre><code>find_package(GLEW REQUIRED)
  if (GLEW_FOUND)
      include_directories($(GLEW_INCLUDE_DIRS))
  endif()
  </code></pre>
  
  <p><strong>Environment Variables</strong></p>
  
  <p><img src="https://i.stack.imgur.com/eJSQJ.png" alt="enter image description here">
  <img src="https://i.stack.imgur.com/oHgYp.png" alt="enter image description here"></p>
  
  <p>I'm using <strong>MinGW w64</strong> to compile the sources and we successfully linked GLFW and GLM just by copying the includes and libs to their respective folders, but after doing the same with GLEW, CMake still couldn't find it.</p>
  
  <p>Sorry if I wasn't clear enough while formulating the question. I will provide any additional information required.</p>
  
  <hr>
  
  <p>Edit: I've managed to link the header files by specifying their location in the CMake Cache file, though I'm getting undefined reference to glew functions like <code>glewInit()</code>.</p>