-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
52 lines (34 loc) · 1.68 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
cmake_minimum_required(VERSION 3.13)
set(CMAKE_CUDA_ARCHITECTURES 75)
set(CMAKE_CUDA_COMPILER /usr/local/cuda/bin/nvcc)
set(CMAKE_CXX_STANDARD 17)
#set(CMAKE_CUDA_STANDARD 20)
project(MCHand)
add_executable(MCHand main.cpp
)
file(GLOB_RECURSE SRC ${PROJECT_SOURCE_DIR}/src/*.cpp)
message(STATUS ${SRC})
# set(IMGUIDIR ${PROJECT_SOURCE_DIR}/lib/imgui)
add_library(src SHARED ${SRC})
target_include_directories(src PUBLIC /home/mocheng/project/TensorRT/include /home/mocheng/project/TensorRT/parsers/onnx)
set(Torch_DIR "/home/mocheng/software/libtorch-cxx11-abi-shared-with-deps-2.0.1+cu118/libtorch/share/cmake/Torch")
find_package(Torch REQUIRED)
target_include_directories(src PUBLIC ${Torch_INCLUDE_DIRS})
message(STATUS ${Torch_INCLUDE_DIRS})
target_link_directories(src PUBLIC ${Torch_LIBRARY_DIR})
find_package(CUDAToolkit REQUIRED)
target_include_directories(src PUBLIC ${CUDAToolkit_INCLUDE_DIRS})
target_link_directories(src PUBLIC ${CUDAToolkit_LIBRARY_DIR})
find_package(OpenCV REQUIRED)
target_include_directories(src PUBLIC ${OpenCV_INCLUDE_DIRS})
target_link_directories(src PUBLIC ${OpenCV_LIBRARY_DIRS})
#target_link_directories(MCHand PUBLIC lib/libtorchnew/lib)
target_link_directories(src PUBLIC /home/mocheng/software/TensorRT-8.6.1.6/lib)
target_include_directories(src PUBLIC ${PROJECT_SOURCE_DIR}/include)
target_link_libraries(src PUBLIC ${OpenCV_LIBS} torch_cpu nvinfer nvonnxparser /home/mocheng/project/TensorRT/cmake-build-debug/libnvinfer_plugin_debug.so cudart cublas)
target_link_libraries(MCHand src)
configure_file(
/home/mocheng/project/TensorRT/cmake-build-debug/libnvinfer_plugin_debug.so
${PROJECT_SOURCE_DIR}/lib/libnvinfer_plugin.so
COPYONLY
)