@@ -64,13 +64,16 @@ if(YOLOX_USE_TFLITE)
6464 set (INCLUDES ${INCLUDES} ${TFLITE_INCLUDE_DIR} )
6565 set (INCLUDES ${INCLUDES} ${ABSEIL_CPP_ICLUDE_DIR} )
6666 set (INCLUDES ${INCLUDES} ${FLATBUFFERS_INCLUDE_DIR} )
67+ set (TARGET_LIBS ${TFLITE_LIB_PATH} /libtensorflow-lite.so)
68+ target_include_directories (yolox_cpp PUBLIC ${INCLUDES} )
6769endif ()
6870
6971# onnxruntime
7072if (YOLOX_USE_ONNXRUNTIME)
7173 find_library (ONNXRUNTIME NAMES onnxruntime)
7274 set (ENABLE_ONNXRUNTIME ON )
7375 set (TARGET_SRC src/yolox_onnxruntime.cpp)
76+ set (TARGET_LIBS onnxruntime)
7477endif ()
7578
7679configure_file (
@@ -81,24 +84,13 @@ configure_file(
8184ament_auto_add_library(yolox_cpp SHARED ${TARGET_SRC} )
8285ament_target_dependencies(yolox_cpp ${TARGET_DPENDENCIES} )
8386ament_export_dependencies(${TARGET_DPENDENCIES} )
84-
85-
86- if (YOLOX_USE_TENSORRT)
87- target_link_libraries (yolox_cpp ${TARGET_LIBS} )
88- endif ()
87+ target_link_libraries (yolox_cpp ${TARGET_LIBS} )
8988
9089if (YOLOX_USE_TFLITE)
91- target_include_directories (yolox_cpp PUBLIC ${INCLUDES} )
92- target_link_libraries (yolox_cpp ${TFLITE_LIB_PATH} /libtensorflow-lite.so)
9390 ament_export_include_directories(${INCLUDES} )
9491 install (DIRECTORY ${TFLITE_LIB_PATH} / DESTINATION lib)
9592endif ()
9693
97- if (YOLOX_USE_ONNXRUNTIME)
98- target_link_libraries (yolox_cpp onnxruntime)
99- endif ()
100-
101-
10294if (BUILD_TESTING)
10395 find_package (ament_lint_auto REQUIRED)
10496 ament_lint_auto_find_test_dependencies()
0 commit comments