-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
58 lines (50 loc) · 1.68 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
cmake_minimum_required(VERSION 3.13)
project(Rabbit)
set(CMAKE_VERBOSE_MAKEFILE ON)
set(CMAKE_CXX_STANDARD 14)
include_directories(source
source/cl
source/rendering
source/scene
source/utilities
external)
# Try to find OpenCL directly
find_package(OpenCL)
add_executable(Rabbit
external/stb_image_writer.hpp
source/utilities/FileIO.cpp
source/utilities/FileIO.hpp
source/rendering/RenderingContext.cpp
source/rendering/RenderingContext.hpp
source/rendering/RenderingData.cpp
source/rendering/RenderingData.hpp
source/utilities/CLError.cpp
source/utilities/CLError.hpp
source/utilities/Vector.hpp
source/utilities/Common.hpp
source/rendering/Camera.cpp
source/rendering/Camera.hpp
source/scene/SceneParser.cpp
source/scene/SceneParser.hpp
source/rendering/TileRendering.cpp
source/rendering/TileRendering.hpp
source/Main.cpp
source/rendering/RenderingKernels.cpp
source/rendering/RenderingKernels.hpp
source/scene/Scene.cpp
source/scene/Scene.hpp
source/rendering/TileDescription.hpp)
if (APPLE)
target_compile_definitions(Rabbit PRIVATE CL_SILENCE_DEPRECATION)
endif(APPLE)
if (NOT OpenCL_FOUND)
# TODO This is hardocoded to the CUDA folder
target_include_directories(Rabbit PRIVATE $ENV{CUDA_PATH}/include)
target_link_libraries(Rabbit PRIVATE $ENV{CUDA_PATH}/lib/x64/OpenCL.lib)
else()
target_link_libraries(Rabbit OpenCL::OpenCL)
endif()
# Specify flags for build
IF (CMAKE_BUILD_TYPE MATCHES Debug)
TARGET_COMPILE_OPTIONS(Rabbit PRIVATE -Wall -Wextra)
ENDIF ()