Skip to content

Commit 08cde41

Browse files
committed
fix CMakeLists.txt
1 parent adac14f commit 08cde41

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

yolox_ros_cpp/yolox_cpp/CMakeLists.txt

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ if(YOLOX_USE_OPENVINO)
3939
find_package(OpenVINO REQUIRED)
4040

4141
set(ENABLE_OPENVINO ON)
42-
set(TARGET_SRC src/yolox_openvino.cpp)
43-
set(TARGET_LIBS openvino::runtime)
44-
set(TARGET_DPENDENCIES OpenVINO)
42+
set(TARGET_SRC ${TARGET_SRC} src/yolox_openvino.cpp)
43+
set(TARGET_LIBS ${TARGET_LIBS} openvino::runtime)
44+
set(TARGET_DPENDENCIES ${TARGET_DPENDENCIES} OpenVINO)
4545
endif()
4646

4747
if(YOLOX_USE_TENSORRT)
@@ -54,27 +54,29 @@ if(YOLOX_USE_TENSORRT)
5454
PATH_SUFFIXES include)
5555

5656
set(ENABLE_TENSORRT ON)
57-
set(TARGET_SRC src/yolox_tensorrt.cpp)
58-
set(TARGET_LIBS nvinfer nvinfer_plugin)
59-
set(TARGET_DPENDENCIES CUDA)
57+
set(TARGET_SRC ${TARGET_SRC} src/yolox_tensorrt.cpp)
58+
set(TARGET_LIBS ${TARGET_LIBS} nvinfer nvinfer_plugin)
59+
set(TARGET_DPENDENCIES ${TARGET_DPENDENCIES} CUDA)
6060
endif()
6161

6262
# tflite
6363
if(YOLOX_USE_TFLITE)
6464
set(ENABLE_TFLITE ON)
65-
set(TARGET_SRC src/yolox_tflite.cpp)
66-
set(INCLUDES ${INCLUDES} ${TFLITE_INCLUDE_DIR})
67-
set(INCLUDES ${INCLUDES} ${ABSEIL_CPP_ICLUDE_DIR})
68-
set(INCLUDES ${INCLUDES} ${FLATBUFFERS_INCLUDE_DIR})
69-
set(TARGET_LIBS ${TFLITE_LIB_PATH}/libtensorflow-lite.so)
65+
set(TARGET_SRC ${TARGET_SRC} src/yolox_tflite.cpp)
66+
set(TFLITE_INCLUDES
67+
${TFLITE_INCLUDE_DIR}
68+
${ABSEIL_CPP_ICLUDE_DIR}
69+
${FLATBUFFERS_INCLUDE_DIR}
70+
)
71+
set(TARGET_LIBS ${TARGET_LIBS} ${TFLITE_LIB_PATH}/libtensorflow-lite.so)
7072
endif()
7173

7274
# onnxruntime
7375
if(YOLOX_USE_ONNXRUNTIME)
7476
find_library(ONNXRUNTIME NAMES onnxruntime)
7577
set(ENABLE_ONNXRUNTIME ON)
76-
set(TARGET_SRC src/yolox_onnxruntime.cpp)
77-
set(TARGET_LIBS onnxruntime)
78+
set(TARGET_SRC ${TARGET_SRC} src/yolox_onnxruntime.cpp)
79+
set(TARGET_LIBS ${TARGET_LIBS} onnxruntime)
7880
endif()
7981

8082
configure_file(
@@ -88,8 +90,8 @@ ament_export_dependencies(${TARGET_DPENDENCIES})
8890
target_link_libraries(yolox_cpp ${TARGET_LIBS})
8991

9092
if (YOLOX_USE_TFLITE)
91-
target_include_directories(yolox_cpp PUBLIC ${INCLUDES})
92-
ament_export_include_directories(${INCLUDES})
93+
target_include_directories(yolox_cpp PUBLIC ${TFLITE_INCLUDES})
94+
ament_export_include_directories(${TFLITE_INCLUDES})
9395
install(DIRECTORY ${TFLITE_LIB_PATH}/ DESTINATION lib)
9496
endif()
9597

0 commit comments

Comments
 (0)