Skip to content

Commit 2550ecd

Browse files
committed
fix CMakeLists.txt
1 parent 8dd0b1d commit 2550ecd

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

yolox_ros_cpp/yolox_cpp/CMakeLists.txt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,16 @@ endif()
4646

4747
if(YOLOX_USE_TENSORRT)
4848
find_package(CUDA REQUIRED)
49-
find_library(NVINFER NAMES nvinfer REQUIRED)
50-
find_library(NVINFERPLUGIN NAMES nvinfer_plugin REQUIRED)
51-
find_library(NVPARSERS NAMES nvparsers REQUIRED)
52-
find_library(NVONNXPARSER NAMES nvonnxparser REQUIRED)
49+
if (NOT CUDA_TOOLKIT_ROOT_DIR)
50+
set(CUDA_TOOLKIT_ROOT_DIR /usr/local/cuda)
51+
endif()
52+
find_path(TENSORRT_INCLUDE_DIR NvInfer.h
53+
HINTS ${TENSORRT_ROOT} ${CUDA_TOOLKIT_ROOT_DIR}
54+
PATH_SUFFIXES include)
5355

5456
set(ENABLE_TENSORRT ON)
5557
set(TARGET_SRC src/yolox_tensorrt.cpp)
56-
set(TARGET_LIBS nvinfer nvinfer_plugin nvparsers nvonnxparser)
58+
set(TARGET_LIBS nvinfer nvinfer_plugin)
5759
set(TARGET_DPENDENCIES CUDA)
5860
endif()
5961

0 commit comments

Comments
 (0)