-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
84 lines (63 loc) · 2.44 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
cmake_minimum_required (VERSION 3.8)
project(Bubbles C CXX CUDA)
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
include_directories(glad)
file(GLOB_RECURSE sources_files src/*)
add_executable(${PROJECT_NAME} ${sources_files} glad/glad.c)
find_package(glfw3 3.2 REQUIRED)
target_link_libraries(Bubbles glfw)
set_property(TARGET Bubbles PROPERTY CUDA_STANDARD 14)
set_property(TARGET Bubbles PROPERTY CUDA_SEPARABLE_COMPILATION ON)
# ____ _ ____ _ _ _____ __ ___ ____ ____
# / ___| / \ / ___| | | | ____| \ \ / / \ | _ \/ ___|
# | | / _ \| | | |_| | _| \ \ / / _ \ | |_) \___ \
# | |___ / ___ \ |___| _ | |___ \ V / ___ \| _ < ___) |
# \____/_/ \_\____|_| |_|_____| \_/_/ \_\_| \_\____/
set(X_BASE_SIZE 1920 CACHE INTEGER "The start x size of the window (int)")
if(X_BASE_SIZE MATCHES "^[0-9]+$")
add_definitions(-DX_BASE_SIZE=${X_BASE_SIZE})
else()
message( SEND_ERROR "X_BASE_SIZE must be a unsigned integer")
endif()
set(Y_BASE_SIZE 1020 CACHE INTEGER "The start y size of the window (int)")
if(Y_BASE_SIZE MATCHES "^[0-9]+$")
add_definitions(-DY_BASE_SIZE=${Y_BASE_SIZE})
else()
message( SEND_ERROR "Y_BASE_SIZE must be a unsigned integer")
endif()
set(FULL_SCREEN false CACHE BOOL "Decide if window is fullscreen")
if(${FULL_SCREEN})
add_definitions(-DFULL_SCREEN=1)
else()
add_definitions(-DFULL_SCREEN=0)
endif()
set(VSYNC false CACHE BOOL "Enable V-Sync")
if(${VSYNC})
add_definitions(-DVSYNC=1)
else()
add_definitions(-DVSYNC=0)
endif()
set(THREADS_PER_BLOCK 128 CACHE INTEGER "The number of threads in a CUDA block")
if(THREADS_PER_BLOCK MATCHES "^[0-9]+$")
add_definitions(-DTHREADS_PER_BLOCK=${THREADS_PER_BLOCK})
else()
message( SEND_ERROR "THREADS_PER_BLOCK must be a unsigned integer")
endif()
set(NUM_REFL 2 CACHE INTEGER "The number of reflexions of a ray")
if(NUM_REFL MATCHES "^[0-9]+$")
add_definitions(-DNUM_REFL=${NUM_REFL})
else()
message( SEND_ERROR "NUM_REFL must be a unsigned integer")
endif()
set(MAX_NUM_BUBBLES 40 CACHE INTEGER "The maximum number of bubbles")
if(MAX_NUM_BUBBLES MATCHES "^[0-9]+$")
add_definitions(-DMAX_NUM_BUBBLES=${MAX_NUM_BUBBLES})
else()
message( SEND_ERROR "MAX_NUM_BUBBLES must be a unsigned integer")
endif()
set(MAX_OBJECTS 200 CACHE INTEGER "The maximum number of objects")
if(MAX_OBJECTS MATCHES "^[0-9]+$")
add_definitions(-DMAX_OBJECTS=${MAX_OBJECTS})
else()
message( SEND_ERROR "MAX_OBJECTS must be a unsigned integer")
endif()