-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
87 lines (70 loc) · 1.9 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
cmake_minimum_required(VERSION 3.19)
project( BaKGL )
find_package(SDL REQUIRED)
include_directories(${SDL_INCLUDE_DIR})
find_package(OpenGL REQUIRED)
find_package(GLUT REQUIRED)
find_package(GLEW REQUIRED)
find_package(glm REQUIRED)
find_package(glfw3 3.3 REQUIRED)
include_directories(".")
add_subdirectory("graphics")
add_subdirectory("imgui")
add_subdirectory("xbak")
include_directories("src")
set(APP_INCLUDES
graphics
imgui
xbak
)
set(LINK_3D_LIBRARIES
glfw
${GLEW_LIBRARIES}
${GLM_LIBRARIES}
${OPENGL_LIBRARY}
)
set(CXX_IGNORE "-Wno-unused-variable -Wno-unused-parameter")
set(CMAKE_CXX_FLAGS "-g -std=c++20 -Wall -Wextra -Werror ${CXX_IGNORE}")
list(APPEND APP_BINARIES
compile_shaders
dialog_explorer
display_dialog
display_gds
display_object
display_tile
display_save
main2d
main3d
show_imgui
)
foreach (APP_BIN IN LISTS APP_BINARIES)
add_executable (${APP_BIN} app/${APP_BIN}.cpp ${APP_INCLUDES})
target_link_libraries(${APP_BIN} dl pthread ${LINK_3D_LIBRARIES} SDL ${APP_INCLUDES})
endforeach()
# Be nice to run this over all the shaders
# Need to add dependencies on "compile_shaders" and on the shaders referenced...
execute_process(
COMMAND "${CMAKE_BINARY_DIR}/compile_shaders vertex.glsl fragment.glsl"
RESULT_VARIABLE STATUS)
if(${STATUS} AND NOT ${STATUS} EQUAL "0")
message(FATAL_ERROR "Failed to compile shaders")
endif()
# XBaK Executables
list(APPEND XBAK_BINARIES
dumpbmx
dumpact_bmx
dumpchar_bmx
dumpzone_bmx
dumppal
dumpobj
dumptbl
dumpscx
dumpwld
resourcedemo
)
foreach (XBAK_BIN IN LISTS XBAK_BINARIES)
add_executable (${XBAK_BIN} xbak/${XBAK_BIN}.cc ${XBAK} ${SDL_INCLUDE_DIR})
target_link_libraries(${XBAK_BIN} dl pthread xbak SDL)
endforeach()
add_executable (xbak_main xbak/xbak.cc ${XBAK} ${SDL_INCLUDE_DIR})
target_link_libraries(xbak_main dl pthread xbak SDL)