-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
68 lines (56 loc) · 2.29 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
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
cmake_minimum_required(VERSION 3.21)
project(gl-game LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED true)
set(CMAKE_CXX_COMPILER "g++")
set(CMAKE_CXX_FLAGS
"-fexec-charset=850"
"-I${PROJECT_SOURCE_DIR}"
"-I${PROJECT_SOURCE_DIR}/deps/glew-2.1.0/include"
"-I${PROJECT_SOURCE_DIR}/deps/glfw-3.3.9.bin.WIN64/include"
"-I${PROJECT_SOURCE_DIR}/deps/glfw-3.3.9.bin.WIN64/include"
"-I${PROJECT_SOURCE_DIR}/deps/libsrt-cebf7ca/src"
)
file(GLOB_RECURSE headers RELATIVE ${PROJECT_SOURCE_DIR} impl/**/*.h impl/*.h)
file(GLOB_RECURSE sources RELATIVE ${PROJECT_SOURCE_DIR} impl/**/*.cpp impl/*.cpp)
add_executable("gl-game" ${sources})
target_include_directories("gl-game" INTERFACE ${PROJECT_SOURCE_DIR})
target_sources("gl-game" PRIVATE FILE_SET headers BASE_DIRS TYPE HEADERS)
include(CMakePrintHelpers)
# cmake_print_variables(headers)
# GLORIOUS GLEW
add_library("glew" STATIC IMPORTED)
target_include_directories("glew" INTERFACE "deps/glew-2.1.0/include")
set_target_properties(
"glew"
PROPERTIES IMPORTED_LOCATION
${PROJECT_SOURCE_DIR}/deps/glew-2.1.0/lib/libglew32.a
)
# SPLENDID GLFW
add_library("glfw" STATIC IMPORTED)
target_include_directories("glfw" INTERFACE deps/glfw-3.3.9.bin.WIN64/include)
set_target_properties(
"glfw"
PROPERTIES IMPORTED_LOCATION
${PROJECT_SOURCE_DIR}/deps/glfw-3.3.9.bin.WIN64/lib-mingw-w64/libglfw3.a
)
# EXCELLENTE LIBRSRT
add_library("libsrt" STATIC IMPORTED)
target_include_directories("libsrt" INTERFACE deps/libsrt-cebf7ca/src)
set_target_properties(
"libsrt"
PROPERTIES IMPORTED_LOCATION
${PROJECT_SOURCE_DIR}/deps/libsrt-cebf7ca/libsrt.a
)
# AMAZING STB
add_library("stb-image" INTERFACE deps/stb_image.h)
target_compile_definitions("gl-game" PRIVATE "GLEW_STATIC")
target_compile_options("gl-game" PRIVATE "-Wall")
target_compile_options("gl-game" PRIVATE "-O0")
target_compile_options("gl-game" PRIVATE "-m64")
target_compile_options("gl-game" PRIVATE "-g")
target_compile_options("gl-game" PRIVATE "-finput-charset=UTF-8")
target_link_options("gl-game" PRIVATE "-static" "-m64")
target_link_libraries("gl-game" "glew" "glfw")
target_link_libraries("gl-game" "opengl32" "-lglu32" "-lgdi32")
target_link_libraries("gl-game" "libsrt" "stb-image")