-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
64 lines (53 loc) · 2.2 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
cmake_minimum_required(VERSION 3.12)
project(oclbhgs C)
set(CMAKE_C_STANDARD 99)
find_package(OpenCL REQUIRED)
find_package(OpenGL REQUIRED)
find_package(GLUT REQUIRED)
set(HEADERS
./sources/headers/galaxy.h
./sources/headers/cell.h
./sources/headers/body.h
./sources/headers/mass.h
./sources/headers/com.h
./sources/headers/position.h
./sources/headers/ocl.h
./sources/headers/ogl.h
./sources/headers/keys.h
./sources/headers/color.h
./sources/kernel_headers/galaxy.h
./sources/kernel_headers/cell.h
./sources/kernel_headers/body.h
./sources/kernel_headers/mass.h
./sources/kernel_headers/com.h
./sources/kernel_headers/position.h
./sources/kernel_headers/ocl.h
)
set(SOURCES
./sources/logics/galaxy.c
./sources/logics/body.c
./sources/logics/cell.c
./sources/logics/ocl.c
./sources/logics/ogl.c
./sources/kernel/_galaxy_contains_losts.cl
./sources/kernel/_galaxy_dispatch_losts.cl
./sources/kernel/_body_sort.cl
./sources/kernel/_cell_clear_idxs.cl
./sources/kernel/_cell_set_idxs.cl
./sources/kernel/_cell_set_amount.cl
./sources/kernel/_galaxy_contains_sub_dispatchables.cl
./sources/kernel/_galaxy_dispatch_sub_dispatchables.cl
./sources/kernel/_galaxy_clear_inactive_cells.cl
./sources/kernel/_galaxy_compute_com.cl
./sources/kernel/_galaxy_compute_accelerations.cl
./sources/kernel/_body_apply_accelerations.cl
)
add_compile_definitions(OPENCL_HOST=true)
set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} "-O3 -Wall -Wextra -Wno-deprecated")
add_executable(oclbhgs main.c ${HEADERS} ${SOURCES})
if(APPLE)
target_link_libraries(oclbhgs ${OpenCL_LIBRARY} ${GLFW_LIBRARIES} ${GLEW_LIBRARIES} ${OPENGL_gl_LIBRARY} ${GLUT_LIBRARY} pthread m)
else()
target_link_libraries(oclbhgs ${OpenCL_LIBRARY} ${GLFW_LIBRARIES} ${GLEW_LIBRARIES} ${OPENGL_gl_LIBRARY} ${GLUT_LIBRARY} GLU pthread m)
endif()
target_include_directories(oclbhgs PRIVATE ${OpenCL_INCLUDE_DIRS} ./cmake-build-debug ${GLFW_INCLUDE_DIRS} ${GLEW_INCLUDE_DIR} ${GLM_INCLUDE_DIR} ${GLUT_INCLUDE_DIRS})