24 lines
611 B
CMake
24 lines
611 B
CMake
cmake_minimum_required(VERSION 3.9)
|
|
|
|
project(OpengGL_Timing_Example)
|
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
set(CMAKE_VERBOSE_MAKEFILE ON)
|
|
|
|
find_package(OpenGL REQUIRED)
|
|
find_package(GLUT REQUIRED)
|
|
|
|
set( NAME_SRC
|
|
main.cpp
|
|
)
|
|
|
|
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
|
|
add_executable( opengl_timing_example ${NAME_SRC} ${NAME_HEADERS} )
|
|
|
|
if (APPLE)
|
|
# Equivalent to pass flags -framework OpenGL
|
|
target_link_libraries(opengl_timing_example OpenGL::GL GLUT::GLUT)
|
|
else()
|
|
# Equivalent to pass flags -lGL, -lGLU and -lglut
|
|
target_link_libraries(opengl_timing_example GL GLU glut )
|
|
endif() |