-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
35 lines (28 loc) · 1.14 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
cmake_minimum_required(VERSION 3.20)
project(3dGraphBuilder)
cmake_policy(SET CMP0072 NEW)
cmake_policy(SET CMP0074 NEW)
set(CMAKE_CXX_STANDARD 20)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/modules")
find_package(OpenGL REQUIRED)
find_package(GLEW REQUIRED)
find_package(SDL2 REQUIRED)
if(APPLE)
# brew version of glew doesn't provide GLEW_* variables
get_target_property(GLEW_INCLUDE_DIRS GLEW::GLEW INTERFACE_INCLUDE_DIRECTORIES)
get_target_property(GLEW_LIBRARIES GLEW::GLEW INTERFACE_LINK_LIBRARIES)
get_target_property(GLEW_LIBRARY GLEW::GLEW LOCATION)
list(APPEND GLEW_LIBRARIES "${GLEW_LIBRARY}")
endif()
set(TARGET_NAME "${PROJECT_NAME}")
add_executable(${TARGET_NAME} main.cpp Scene.cpp Scene.h Mesh.h Graphics.h Function.cpp Function.h Isolines.cpp Isolines.h Surface.cpp Surface.h Grid.cpp Grid.h Functions.h)
target_include_directories(${TARGET_NAME} PUBLIC
"${SDL2_INCLUDE_DIRS}"
"${GLEW_INCLUDE_DIRS}"
"${OPENGL_INCLUDE_DIRS}"
)
target_link_libraries(${TARGET_NAME} PUBLIC
"${GLEW_LIBRARIES}"
"${SDL2_LIBRARIES}"
"${OPENGL_LIBRARIES}"
)