title: CMake cannot find GLEW
body: <p>I'm trying to link GLEW to my CMake project with little success.
  Apparently, it can't find <code>GLEW_LIBRARIES</code>.</p>
  
  <p>I'm using CLion 2019.3.4 and MinGW.</p>
  
  <p>So far I've tried these things:</p>
  
  <ol>
  <li>Defining <code>GLEW_LIBRARIES</code></li>
  <li>Defining <code>GLEW_STATIC_LIBRARIES</code> and <code>GLEW_SHARED_LIBRARIES</code>, as the <code>FindGLEW.cmake</code> file documents that (Line 41 to 45).</li>
  <li>Doing both of the above.</li>
  <li>Doing 1 and 2 except instead of <code>LIBRARIES</code> it is <code>LIBRARY</code>.</li>
  </ol>
  
  <p>I don't know what else to do.</p>
  
  <p>Heres the CMake lists for reference:</p>
  
  <pre><code>cmake_minimum_required(VERSION 3.15)
  project(myProject)
  
  set(CMAKE_CXX_STANDARD 17)
  set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++")
  set(CMAKE_MODULE_PATH "${CMAKE_HOME_DIRECTORY}/cmake_modules/")
  
  # This part of the code is actually in a separate file,
  # called LibrarySetup.cmake
  #
  # include(LibrarySetup.cmake)
  
  if(WIN32)
      set(LIB_PREFIX "")
      set(LIB_SUFFIX ".dll")
  elseif(UNIX)
      set(LIB_PREFIX "lib")
      set(LIB_SUFFIX ".lib")
  endif()
  
  set(GLFW_INCLUDE_DIR "include/glfw/include/")
  set(GLFW_LIBRARY "include/glfw/lib/${LIB_PREFIX}glfw3${LIB_SUFFIX}")
  
  set(GLEW_INCLUDE_DIR "include/glew/include/")
  set(GLEW_SHARED_LIBRARIES "include/glew/lib/Release/Win32/glew32.lib")
  set(GLEW_STATIC_LIBRARIES "include/glew/lib/Release/Win32/glew32s.lib")
  set(GLEW_VERBOSE)
  
  # And here the external file ends.
  
  find_package(GLFW REQUIRED)
  find_package(GLEW REQUIRED)
  
  include_directories(${GLFW_INCLUDE_DIR} ${GLEW_INCLUDE_DIRS})
  
  add_subdirectory(include/glfw)
  add_executable(myProject main.cpp)
  target_link_libraries(myProject ${GLFW_LIBRARY} ${GLEW_LIBRARIES})
  </code></pre>
  
  <p>And the errors:</p>
  
  <pre><code>~\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\193.6494.38\bin\cmake\win\bin\cmake.exe -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - MinGW Makefiles" "~\Documents\CLion Projects\myProject"
  CMake Error at ~/AppData/Local/JetBrains/Toolbox/apps/CLion/ch-0/193.6494.38/bin/cmake/win/share/cmake-3.15/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
    Could NOT find GLEW (missing: GLEW_LIBRARIES)
  Call Stack (most recent call first):
    ~/AppData/Local/JetBrains/Toolbox/apps/CLion/ch-0/193.6494.38/bin/cmake/win/share/cmake-3.15/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
    ~/AppData/Local/JetBrains/Toolbox/apps/CLion/ch-0/193.6494.38/bin/cmake/win/share/cmake-3.15/Modules/FindGLEW.cmake:207 (find_package_handle_standard_args)
    CMakeLists.txt:12 (find_package)
  
  
  -- Configuring incomplete, errors occurred!
  See also "~/Documents/CLion Projects/myProject/cmake-build-debug/CMakeFiles/CMakeOutput.log".
  
  [Failed to reload]
  </code></pre>