-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
56 lines (44 loc) · 1.43 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
cmake_minimum_required(VERSION 3.30)
project(voxel_mania)
set(CMAKE_CXX_STANDARD 23)
set(BINARY_DIRECTORY ${CMAKE_BINARY_DIR} CACHE PATH "The target destination of our build")
set(BINARY_DIRECTORY_LIBS ${CMAKE_BINARY_DIR} CACHE PATH "The target destination of our libs")
include(cmake_scripts/compiler_flags.cmake)
add_subdirectory(libraries)
find_package(OpenGL REQUIRED)
add_executable(voxel_mania main.cpp
Camera.cpp
Camera.h
data/cube.h
InputHandling.cpp
InputHandling.h
AppData.h
math_ops.h
math_ops.cpp
RandomNumberGeneration.cpp
RandomNumberGeneration.h
Perlin.h
Perlin.cpp
)
target_link_libraries(voxel_mania
PUBLIC
libglew_shared
SDL3::SDL3
LinearAlgebra
Trigonometry
)
##### -------------COPY SHADERS --------------
set(SHADER_SOURCE_DIR "${CMAKE_SOURCE_DIR}/data")
set(SHADER_DEST_DIR "${BINARY_DIRECTORY}/data")
# Copy the shaders to the build directory
add_custom_target(copy_shaders ALL
COMMAND ${CMAKE_COMMAND} -E copy_directory
"${SHADER_SOURCE_DIR}" "${SHADER_DEST_DIR}"
COMMENT "Copying shader programs to build directory"
)
add_dependencies(voxel_mania copy_shaders)
add_custom_command(
TARGET voxel_mania POST_BUILD
COMMAND ${CMAKE_COMMAND} --install ${CMAKE_BINARY_DIR}
COMMENT "Running the install step after all builds are complete"
)