-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
72 lines (64 loc) · 2.17 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
cmake_minimum_required(VERSION 3.15)
project(lvvi LANGUAGES CXX VERSION 0.1)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR})
file(GLOB test_src RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/test/*.cpp")
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -framework OpenGL")
find_package(PkgConfig REQUIRED)
pkg_check_modules(glew REQUIRED IMPORTED_TARGET glew)
pkg_check_modules(glfw REQUIRED IMPORTED_TARGET glfw3)
pkg_check_modules(opencv REQUIRED IMPORTED_TARGET opencv4)
pkg_check_modules(spdlog REQUIRED IMPORTED_TARGET spdlog)
include_directories(
"./include"
"./include/mediapipe"
)
link_directories(
"./lib/mac"
)
foreach(main_file IN LISTS test_src)
get_filename_component(test_name ${main_file} NAME_WE)
add_executable(${test_name} ${main_file})
target_link_libraries(${test_name}
PkgConfig::glew
PkgConfig::glfw
PkgConfig::opencv
PkgConfig::spdlog
mediapipe
)
endforeach()
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
# include_directories(
# "./include"
# "./include/GL"
# "./include/GLFW"
# "./include/spdlog"
# "./include/mediapipe"
# "D:/opencv/build/include"
# "D:/opencv/build/include/opencv2"
# )
# link_directories(
# "./lib"
# "D:/onnxruntime/onnxruntime-win-x64-gpu-1.12.0/lib"
# "D:/opencv/build/x64/vc15/lib"
# "D:/opencv/build/x64/vc15/bin"
# )
# foreach(mainfile IN LISTS test_src)
# get_filename_component(testname ${mainfile} NAME_WE)
# add_executable(${testname} ${mainfile})
# target_link_libraries(${testname}
# glew32
# glfw3
# opengl32
# opencv_world3410
# onnxruntime
# onnxruntime_providers_cuda
# onnxruntime_providers_shared
# onnxruntime_providers_tensorrt
# mediapipe
# )
# endforeach()
endif()