-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.cmake
45 lines (38 loc) · 963 Bytes
/
config.cmake
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
set(HALIDE_ROOT $ENV{HALIDE_ROOT} CACHE PATH "Path to Halide")
if(HALIDE_ROOT STREQUAL "")
message(FATAL_ERROR "Set appropriate path to Halide")
endif()
# OpenCV
find_package(OpenCV 3 REQUIRED)
if (UNIX)
add_compile_options(-Wno-format-security)
endif()
# onnxruntime
set(ONNXRUNTIME_ROOT $ENV{ONNXRUNTIME_ROOT} CACHE PATH "Path to onnxruntime")
if(ONNXRUNTIME_ROOT STREQUAL "")
message(FATAL_ERROR "Set appropriate path to onnxruntime")
endif()
set(INCLUDE_DIRS
${HALIDE_ROOT}/include
${OpenCV_INCLUDE_DIRS}
${ONNXRUNTIME_ROOT}/include)
set(LINK_DIRS
${HALIDE_ROOT}/bin
${OpenCV_DIR}/lib
${ONNXRUNTIME_ROOT}/lib)
set(RUNTIME_ENVS
LD_LIBRARY_PATH ${HALIDE_ROOT}/bin
LD_LIBRARY_PATH ${OpenCV_DIR}/lib
LD_LIBRARY_PATH ${ONNXRUNTIME_ROOT}/lib)
if (UNIX)
set(LIBRARIES
rt
dl
pthread
m
z
${OpenCV_LIBS})
else()
set(LIBRARIES
${OpenCV_LIBS})
endif()