Skip to content

Instantly share code, notes, and snippets.

@harderthan
Last active July 30, 2018 07:57
Show Gist options
  • Save harderthan/b86161eecf88c113065734646c480b2b to your computer and use it in GitHub Desktop.
Save harderthan/b86161eecf88c113065734646c480b2b to your computer and use it in GitHub Desktop.
TensorRT_with-ROS_CMakeLists
# by Kwanghoe, kheo1772@gmail.ac.kr
#-------------------------------------------------------------------------------
cmake_minimum_required(VERSION 2.8.3)
project(rt_example)
add_compile_options(-std=c++11)
#-------------------------------------------------------------------------------
# Find Cuda and Additional packages
if(VIBRANTE)
set(ARCH_DIR "aarch64-linux")
else()
set(ARCH_DIR "x86_64-linux")
endif()
set(cuda_runtime_api_DIR /usr/local/cuda/targets/${ARCH_DIR}/include CACHE INTERNAL "")
find_package(CUDA)
include_directories(${cuda_runtime_api_DIR})
include_directories(/usr/local/nvidia/tensorrt/include)
#-------------------------------------------------------------------------------
# Catkin
find_package(catkin REQUIRED COMPONENTS
roscpp
std_msgs
)
catkin_package()
include_directories(
${catkin_INCLUDE_DIRS}
)
#-------------------------------------------------------------------------------
set(SOURCE src/main.cpp)
include_directories(${PROJECT_SOURCE_DIR}/include)
add_executable(${PROJECT_NAME}_node ${SOURCE})
target_link_libraries(${PROJECT_NAME}_node
${catkin_LIBRARIES}
${CUDA_LIBRARIES}
nvinfer
nvparsers
nvinfer_plugin
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment