-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
37 lines (28 loc) · 890 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
31
32
33
34
35
36
37
project(kt_bvh)
cmake_minimum_required(VERSION 3.3)
add_library(kt_bvh
kt_bvh.h
kt_bvh.cpp
)
target_include_directories(kt_bvh PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
add_executable(pathtracer_test
pathtracer_test.cpp
fast_obj.h
stb_image_write.h
)
target_link_libraries(pathtracer_test kt_bvh)
set_property(TARGET pathtracer_test PROPERTY VS_DEBUGGER_WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
# pdbs in debug
if(MSVC)
add_definitions(/Zi -D_CRT_SECURE_NO_WARNINGS)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /DEBUG")
endif()
if(MSVC)
set_target_properties(kt_bvh pathtracer_test PROPERTIES
COMPILE_FLAGS "/W4 /WX -DNOMINMAX"
elseif("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
set_target_properties(kt_bvh pathtracer_test PROPERTIES
COMPILE_FLAGS "-Wall -Werror"
)
)
endif()