-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
49 lines (37 loc) · 896 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
38
39
40
41
42
43
44
45
46
47
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
cmake_minimum_required(VERSION 2.8.3)
project(twinlitenet_onnx)
# Options
option(ENABLE_CUDA "Enable CUDA" OFF)
if(ENABLE_CUDA)
message(STATUS "CUDA is enabled")
add_definitions(-DENABLE_CUDA)
endif()
find_package(OpenCV REQUIRED)
find_package(onnxruntime REQUIRED)
set(HEADER_FILES
include/twinlitenet_onnxruntime.hpp)
set(SOURCE_FILES
src/main.cpp
src/twinlitenet_onnxruntime.cpp)
# general Includes
include_directories(
include
${OpenCV_INCLUDE_DIRS}
)
# cuda includes
if(ENABLE_CUDA)
find_package(CUDA REQUIRED)
include_directories(
${CUDA_INCLUDE_DIRS}
)
endif()
add_executable(main ${SOURCE_FILES} ${HEADER_FILES})
target_link_libraries(main
${OpenCV_LIBS}
onnxruntime::onnxruntime)
# cuda libs
if(ENABLE_CUDA)
target_link_libraries(main
${CUDA_LIBRARIES})
endif()