Skip to content

Commit

Permalink
find_package cuda is deprecated. CMAKE_CUDA_COMPILED was added to cma…
Browse files Browse the repository at this point in the history
…ke 3.11.
  • Loading branch information
= committed Feb 7, 2024
1 parent bcae7ea commit b0e06c1
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions cmake/pcl_find_cuda.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,24 @@ if(MSVC)
set(CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE OFF CACHE BOOL "CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE")
endif()

set(CUDA_FIND_QUIETLY TRUE)
find_package(CUDA 9.0)
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.11)
include(CheckLanguage)
check_language(CUDA)
if(CMAKE_CUDA_COMPILER)
enable_language(CUDA)
set(CUDA_FOUND TRUE)
set(CUDA_VERSION_STRING ${CMAKE_CUDA_COMPILER_VERSION})
else()
message(STATUS "No CUDA compiler found")
endif()
else()
set(CUDA_FIND_QUIETLY TRUE)
find_package(CUDA 9.0)
endif()

if(CUDA_FOUND)
message(STATUS "Found CUDA Toolkit v${CUDA_VERSION_STRING}")

enable_language(CUDA)
set(HAVE_CUDA TRUE)

if (CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA")
Expand Down

0 comments on commit b0e06c1

Please sign in to comment.