-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
44 lines (31 loc) · 1.39 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
39
40
41
42
43
cmake_minimum_required(VERSION 3.10)
project(Projet_OpenGL)
# Stop if in the wrong place
if (CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
message(FATAL_ERROR "Source and build directories must be different!")
endif()
link_directories(${CMAKE_SOURCE_DIR}/lib)
# Find glfw
find_package(glfw3 3.3 REQUIRED)
message(STATUS "Found GLFW3 in ${GLFW3_INCLUDE_DIR}")
# Create an executable
add_executable(test src/main.cpp src/common/glad.c)
# Link the executable to the libraries
target_link_libraries(test glfw)
target_include_directories(test PUBLIC include)
# Create examples
add_executable(curve example/bezier_curve.cpp src/common/glad.c)
target_link_libraries(curve glfw)
target_include_directories(curve PUBLIC include)
add_executable(curve_poly example/bezier_curve_poly.cpp src/common/glad.c)
target_link_libraries(curve_poly glfw)
target_include_directories(curve_poly PUBLIC include)
add_executable(surface example/bezier_surface.cpp src/common/glad.c)
target_link_libraries(surface glfw)
target_include_directories(surface PUBLIC include)
add_executable(surface_poly example/bezier_surface_poly.cpp src/common/glad.c)
target_link_libraries(surface_poly glfw)
target_include_directories(surface_poly PUBLIC include)
add_executable(surface_normals example/bezier_surface_normals.cpp src/common/glad.c)
target_link_libraries(surface_normals glfw)
target_include_directories(surface_normals PUBLIC include)