-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
30 lines (24 loc) · 1009 Bytes
/
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
cmake_minimum_required(VERSION 3.10)
# enable exporting commands for use with vscode
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# set the project name
project(raytracer)
include_directories(raytracer PUBLIC src include)
find_package(OpenMP REQUIRED)
# specify the C++ standard
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_CXX_FLAGS "-Ofast -flto -ffast-math -Wall -Wextra -Wno-unused-parameter -pedantic -DUSE_FLOATS=0")
set(CMAKE_EXE_LINKER_FLAGS "-Ofast -flto -ffast-math")
# pull in boost libraries
set(Boost_USE_STATIC_LIBS OFF)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)
find_package(Boost REQUIRED COMPONENTS random)
include_directories(${Boost_INCLUDE_DIRS})
# add the executable
file(GLOB raytracer_SRC CONFIGURE_DEPENDS "src/*.cpp" "src/objects/*.cpp")
include_directories(src/objects/ src/scenes/)
add_executable(raytracer ${raytracer_SRC})
target_link_libraries(raytracer ${Boost_LIBRARIES})
target_link_libraries(raytracer OpenMP::OpenMP_CXX)