OpenGL with CMake

CMake File

cmake_minimum_required(VERSION 3.6)
project(ogl)

set(CMAKE_CXX_STANDARD 11)

find_package(glfw3 3.2 REQUIRED)
find_package(OpenGL REQUIRED)

if (OPENGL_FOUND)
    message("opengl found")
    message("include dir: ${OPENGL_INCLUDE_DIR}")
    message("link libraries: ${OPENGL_gl_LIBRARY}")
else (OPENGL_FOUND)
    message("opengl not found")
endif()


set(SOURCE_FILES main.cpp)
add_executable(ogl ${SOURCE_FILES})

include_directories(${OPENGL_INCLUDE_DIR})

target_link_libraries(ogl ${OPENGL_gl_LIBRARY} glfw)
target_link_libraries(ogl ${OPENGL_glu_LIBRARY})