Skip to content

Commit

Permalink
fix: skip building tensorrt yolox packages if cuda is not found (auto…
Browse files Browse the repository at this point in the history
…warefoundation#2412)

* fix: skip building tensorrt yolox packages if cuda is not found

Signed-off-by: Daisuke Nishimatsu <border_goldenmarket@yahoo.co.jp>

* fix typo

Signed-off-by: Daisuke Nishimatsu <border_goldenmarket@yahoo.co.jp>
  • Loading branch information
wep21 authored and tzhong518 committed Dec 8, 2022
1 parent d647678 commit ee3321e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
7 changes: 6 additions & 1 deletion common/cuda_utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ project(cuda_utils)
find_package(autoware_cmake REQUIRED)
autoware_package()

find_package(CUDA REQUIRED)
find_package(CUDA)

if(NOT ${CUDA_FOUND})
message(WARNING "cuda is not found, so the cuda_utils package won't be built.")
return()
endif()

install(
DIRECTORY include/${PROJECT_NAME}/
Expand Down
6 changes: 3 additions & 3 deletions common/tensorrt_common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ project(tensorrt_common)
find_package(autoware_cmake REQUIRED)
autoware_package()

find_package(CUDA REQUIRED)
find_package(CUDNN REQUIRED)
find_package(TENSORRT REQUIRED)
find_package(CUDA)
find_package(CUDNN)
find_package(TENSORRT)

if(NOT (${CUDA_FOUND} AND ${CUDNN_FOUND} AND ${TENSORRT_FOUND}))
message(WARNING "cuda, cudnn, tensorrt libraries are not found")
Expand Down
6 changes: 6 additions & 0 deletions perception/tensorrt_yolox/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
cmake_minimum_required(VERSION 3.5)
project(tensorrt_yolox)

find_package(tensorrt_common)
if(NOT ${tensorrt_common_FOUND})
message(WARNING "The tensorrt_common package is not found. Please check its dependencies.")
return()
endif()

find_package(autoware_cmake REQUIRED)
autoware_package()

Expand Down

0 comments on commit ee3321e

Please sign in to comment.