-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
38 lines (29 loc) · 1 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
cmake_minimum_required(VERSION 3.15)
project(Part_2___Graphics_Alternate)
if (WIN32)
set(FREEGLUT_INCLUDE_DIRS "C:/Program\ Files/Common\ Files/freeglut/include")
set(FREEGLUT_LIBRARY_DIRS "C:/Program\ Files/Common\ Files/freeglut/lib")
endif (WIN32)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated -Werror=return-type")
find_package (OpenGL REQUIRED)
if (APPLE)
find_package(GLUT REQUIRED)
endif (APPLE)
if (WIN32)
include_directories(${OPENGL_INCLUDE_DIR} ${FREEGLUT_INCLUDE_DIRS})
link_directories(${FREEGLUT_LIBRARY_DIRS})
elseif (APPLE)
include_directories(${OPENGL_INCLUDE_DIR} ${GLUT_INCLUDE_DIRS})
endif ()
file(GLOB SOURCE_FILES
*.cpp
*.h
)
add_executable(graphics Scene Camera Camera3D Camera4D Object Object3D Object4D
${SOURCE_FILES})
if (WIN32)
target_link_libraries (graphics ${OPENGL_LIBRARIES} freeglut)
elseif (APPLE)
target_link_libraries (graphics ${OPENGL_LIBRARIES} ${GLUT_LIBRARIES})
endif ()