-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
51 lines (39 loc) · 1.11 KB
/
CMakeLists.txt
File metadata and controls
51 lines (39 loc) · 1.11 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
cmake_minimum_required(VERSION 3.20)
project(OM3D)
# CPP setup
set(CMAKE_CXX_STANDARD 17)
if(MSVC)
set(COMPILE_OPTIONS /permissive- /W3 -D_CRT_SECURE_NO_DEPRECATE /Zc:preprocessor /wd5105)
else()
set(EXTRA_WARNINGS -Wfloat-conversion)
set(COMPILE_OPTIONS -pedantic -Werror -Wall -Wextra ${EXTRA_WARNINGS})
endif()
# setup external libraries
add_subdirectory(external/glfw)
add_subdirectory(external/glm)
include_directories(external/glfw/include)
include_directories(external/glad/include)
include_directories(external/glm)
include_directories(external)
include_directories(${OM3D_SOURCE_DIR}/src)
file(GLOB_RECURSE SOURCE_FILES
"src/*.h"
"src/*.cpp"
)
file(GLOB_RECURSE EXTERNAL_FILES
"external/glad/*.c"
"external/glad/*.h"
"external/imgui/*.cpp"
"external/imgui/*.h"
)
# Shader files
file(GLOB_RECURSE SHADER_FILES
"shaders/*.frag"
"shaders/*.vert"
"shaders/*.geom"
"shaders/*.comp"
"shaders/*.glsl"
)
add_executable(OM3D ${SOURCE_FILES} ${EXTERNAL_FILES} ${SHADER_FILES})
target_link_libraries(OM3D glfw)
target_compile_options(OM3D PUBLIC ${COMPILE_OPTIONS})