-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
71 lines (59 loc) · 1.73 KB
/
CMakeLists.txt
File metadata and controls
71 lines (59 loc) · 1.73 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
CMAKE_MINIMUM_REQUIRED(VERSION 3.22)
project(fcg_final LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
include(FetchContent)
if (WIN32)
if (MINGW)
set(LIBS ${PROJECT_SOURCE_DIR}/lib/libglfw3.a)
elseif (MSVC)
set(LIBS ${PROJECT_SOURCE_DIR}/lib-vc2022/glfw3.lib)
else ()
message(FATAL_ERROR "This project file only supports MINGW or MSVC toolchain on Windows.")
endif ()
list(APPEND LIBS gdi32 opengl32)
else ()
find_package(OpenGL REQUIRED)
find_package(X11 REQUIRED)
set(LIBS ${PROJECT_SOURCE_DIR}/lib-linux/libglfw3.a X11 GL)
endif ()
link_libraries(${LIBS})
FetchContent_Declare(
glm
GIT_REPOSITORY https://github.com/g-truc/glm.git
GIT_TAG 1.0.0
)
FetchContent_MakeAvailable(glm)
add_compile_definitions(GLM_FORCE_XYZW_ONLY GLM_ENABLE_EXPERIMENTAL)
find_package(tinyobjloader CONFIG)
if (NOT tinyobjloader_FOUND)
FetchContent_Declare(
tinyobjloader
GIT_REPOSITORY https://github.com/tinyobjloader/tinyobjloader.git
GIT_TAG origin/release
)
FetchContent_MakeAvailable(tinyobjloader)
endif ()
FetchContent_Declare(
expected
GIT_REPOSITORY https://github.com/TartanLlama/expected.git
GIT_TAG v1.1.0
)
set(EXPECTED_BUILD_PACKAGE OFF)
FetchContent_MakeAvailable(expected)
FetchContent_Declare(
fmt
GIT_REPOSITORY https://github.com/fmtlib/fmt.git
GIT_TAG 10.2.1
)
FetchContent_MakeAvailable(fmt)
add_compile_definitions(_USE_MATH_DEFINES)
if (MSVC)
add_compile_options(/W4)
else ()
add_compile_options(-Wall -Wextra -Wpedantic)
endif ()
add_compile_definitions(_USE_MATH_DEFINES)
add_subdirectory(glad)
add_subdirectory(stb)
add_subdirectory(src)