-
-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
31 lines (26 loc) · 667 Bytes
/
CMakeLists.txt
File metadata and controls
31 lines (26 loc) · 667 Bytes
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
cmake_minimum_required(VERSION 3.21)
set(CMAKE_CXX_STANDARD 17)
project(SamCPP)
find_package(OpenCV CONFIG REQUIRED)
find_package(gflags CONFIG REQUIRED)
add_library(sam_cpp_lib SHARED sam.h sam.cpp util.h util.cpp)
if (APPLE)
set(onnxruntime_lib ${ONNXRUNTIME_ROOT_DIR}/lib/libonnxruntime.dylib)
else()
set(onnxruntime_lib ${ONNXRUNTIME_ROOT_DIR}/lib/libonnxruntime.so)
endif()
target_include_directories(
sam_cpp_lib PUBLIC
${ONNXRUNTIME_ROOT_DIR}/include
)
target_link_libraries(
sam_cpp_lib PUBLIC
${onnxruntime_lib}
${OpenCV_LIBS}
gflags
)
add_executable(sam_cpp_test test.cpp)
target_link_libraries(
sam_cpp_test PRIVATE
sam_cpp_lib
)