-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
41 lines (32 loc) · 1.19 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
cmake_minimum_required(VERSION 3.20)
project(PathTracer VERSION 1.0.0 LANGUAGES CXX)
# Set output directory to "bin"
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
foreach(OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES})
string(TOUPPER ${OUTPUTCONFIG} OUTPUTCONFIG)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_${OUTPUTCONFIG} "${CMAKE_BINARY_DIR}/bin")
endforeach()
# Add third-party subdirectories
add_subdirectory("${CMAKE_SOURCE_DIR}/vendor/stb")
# Add search scripts generated by Conan to module path
set(CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR} ${CMAKE_MODULE_PATH})
find_package(assimp)
# Define "PathTracer" target
file(GLOB_RECURSE TARGET_SOURCES CONFIGURE_DEPENDS
"${CMAKE_CURRENT_SOURCE_DIR}/src/*.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/src/*.inl"
"${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp"
)
add_executable(PathTracer ${TARGET_SOURCES})
set_target_properties(PathTracer PROPERTIES
CXX_STANDARD 20
CXX_STANDARD_REQUIRED ON
OUTPUT_NAME "path-tracer"
)
target_include_directories(PathTracer PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}/src"
)
target_link_libraries(PathTracer stb assimp::assimp)
target_precompile_headers(PathTracer PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}/src/pch.hpp"
)