-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
106 lines (89 loc) · 2.74 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
cmake_minimum_required(VERSION 3.16.0)
cmake_policy(SET CMP0072 NEW)
set (CMAKE_CXX_STANDARD 20)
project(Betrock VERSION 0.3.6)
find_package(OpenGL REQUIRED)
find_package(glfw3 3.3 REQUIRED)
include_directories(src/include)
add_compile_options(
"-ggdb"
)
file(COPY "${CMAKE_SOURCE_DIR}/src/external/"
DESTINATION "${CMAKE_BINARY_DIR}")
# Configure the version header file
configure_file(${CMAKE_SOURCE_DIR}/src/version.h.in ${CMAKE_SOURCE_DIR}/src/version.h)
add_executable(
Betrock
src/model/chunkBuilder.cpp
src/model/model.cpp
src/nbt/nbt.cpp
src/nbt/nbttag.cpp
src/render/shader.cpp
src/render/vao.cpp
src/render/vbo.cpp
src/render/ebo.cpp
src/render/texture.cpp
src/render/camera.cpp
src/render/mesh.cpp
src/render/sky.cpp
src/world/world.cpp
src/world/regionLoader.cpp
src/world/region.cpp
src/world/chunk.cpp
src/world/blockProperties.cpp
src/helper.cpp
src/debug.cpp
src/main.cpp
src/include/glad.c
src/include/imgui/imgui.cpp
src/include/imgui/imgui_draw.cpp
src/include/imgui/imgui_tables.cpp
src/include/imgui/imgui_widgets.cpp
src/include/imgui/backends/imgui_impl_glfw.cpp
src/include/imgui/backends/imgui_impl_opengl3.cpp
)
set(CMAKE_SYSTEM_NAME Linux)
# TODO: Get Windows Target working
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
set(CMAKE_C_COMPILER i686-w64-mingw32-gcc)
set(CMAKE_CXX_COMPILER i686-w64-mingw32-g++)
set(CMAKE_RC_COMPILER i686-w64-mingw32-windres)
set(CMAKE_RANLIB i686-w64-mingw32-ranlib)
target_link_libraries(
Betrock
gdi32
opengl32
deflate
stb
)
else()
# Apply AddressSanitizer to all build types
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -g")
set(CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} -fsanitize=address")
target_link_libraries(
Betrock
glfw
OpenGL::GL
deflate
stb
${CMAKE_DL_LIBS}
)
endif()
include(CPack)
# Set up CPack for AppImage
set(CPACK_PACKAGE_NAME "Betrock")
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Betrock - Minecraft Beta 1.7.3 World Explorer")
set(CPACK_PACKAGE_VENDOR "Torben J. Virtmann")
set(CPACK_PACKAGE_CONTACT "[email protected]")
set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README.md")
# AppImage specific settings
set(CPACK_GENERATOR "AppImage")
set(CPACK_APPIMAGE_FILE_ASSOCIATIONS "*.betrock")
set(CPACK_PACKAGE_EXECUTABLES "Betrock;Betrock")
# Ensure dependencies are bundled
set(CPACK_APPIMAGE_USE_SYSTEM_LIBS FALSE)
# Install the Betrock executable
install(TARGETS Betrock DESTINATION bin)
# Install additional resources
install(DIRECTORY "${CMAKE_SOURCE_DIR}/src/external/" DESTINATION bin)