-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathCMakeLists.txt
58 lines (48 loc) · 1.25 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
58
cmake_minimum_required(VERSION 2.8.8)
project(aobaker)
if(APPLE)
exec_program(brew
ARGS "info embree | tr ' ' '\n' | grep Cellar"
OUTPUT_VARIABLE EMBREE_PATH)
exec_program(brew
ARGS "info tbb | tr ' ' '\n' | grep Cellar"
OUTPUT_VARIABLE TBB_PATH)
else()
# TODO: Find packages
set(EMBREE_PATH "/usr/local" CACHE PATH "Embree location")
set(TBB_PATH "/usr" CACHE PATH "Threading Building Blocks location")
endif()
message(EMBREE_PATH = ${EMBREE_PATH})
message(TBB_PATH = ${TBB_PATH})
add_subdirectory(thekla)
add_subdirectory(vendor/poshlib)
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp -std=c++11")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11")
endif()
add_definitions(
-O3
-I${EMBREE_PATH}/include
-I${TBB_PATH}/include
-Wall)
link_directories(
${EMBREE_PATH}/lib
${TBB_PATH}/lib)
include_directories(
thekla/thekla
vendor/flag
vendor/stb
vendor/tinyobj)
add_executable(
aobaker
cmdline.c
raytrace.cpp
aobaker.cpp)
target_link_libraries(
aobaker
thekla_atlas
embree
tbb)