-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
55 lines (43 loc) · 1.62 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
cmake_minimum_required(VERSION 3.26...3.29)
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release CACHE STRING "" FORCE)
endif()
if (PROJECT_BINARY_DIR STREQUAL PROJECT_SOURCE_DIR)
message(
FATAL_ERROR
"The binary directory of CMake cannot be the same as source directory!"
"use 'cmake -B build' to specify a different binary directory."
)
endif()
project(
RayTracing
LANGUAGES C CXX
DESCRIPTION "ray tracing with luisa compute"
HOMEPAGE_URL https://github.com/Zero-Starting-Learn-Ray-Tracing/zero
VERSION 0.0.1
)
# you may set the LUISA_COMPUTE_ENABLE_XXX options before including LuisaCompute
add_subdirectory(thirdparty/LuisaCompute)
# setup the output directories to make the executables under the same binary directory as LuisaCompute
include(thirdparty/LuisaCompute/scripts/setup_output_dirs.cmake)
# add your executables
# add_executable(test src/test.cpp)
# target_include_directories(test PUBLIC thirdparty/LuisaCompute/include)
# target_link_libraries(test PRIVATE luisa::compute)
# add_executable(test2 src/test2.cpp)
# target_include_directories(test2 PUBLIC thirdparty/LuisaCompute/include)
# target_link_libraries(test2 PRIVATE luisa::compute)
add_executable(${PROJECT_NAME} src/main.cpp)
target_include_directories(
${PROJECT_NAME}
PUBLIC
thirdparty/LuisaCompute/include
thirdparty/cxxopts/include
${CMAKE_CURRENT_SOURCE_DIR}/include
)
target_link_libraries(${PROJECT_NAME} PRIVATE luisa::compute)