Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 4 additions & 37 deletions cmake/FindDependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -71,44 +71,11 @@ message(STATUS "Configuring COLMAP... done")

set(CUDA_MIN_VERSION "7.0")
if(CUDA_ENABLED)
if(CMAKE_VERSION VERSION_LESS 3.17)
find_package(CUDA QUIET)
if(CUDA_FOUND)
message(STATUS "Found CUDA version ${CUDA_VERSION} installed in "
"${CUDA_TOOLKIT_ROOT_DIR} via legacy CMake (<3.17) module. "
"Using the legacy CMake module means that any installation of "
"COLMAP will require that the CUDA libraries are "
"available under LD_LIBRARY_PATH.")
message(STATUS "Found CUDA ")
message(STATUS " Includes : ${CUDA_INCLUDE_DIRS}")
message(STATUS " Libraries : ${CUDA_LIBRARIES}")

enable_language(CUDA)

macro(declare_imported_cuda_target module)
add_library(CUDA::${module} INTERFACE IMPORTED)
target_include_directories(
CUDA::${module} INTERFACE ${CUDA_INCLUDE_DIRS})
target_link_libraries(
CUDA::${module} INTERFACE ${CUDA_${module}_LIBRARY} ${ARGN})
endmacro()

declare_imported_cuda_target(cudart ${CUDA_LIBRARIES})
declare_imported_cuda_target(curand ${CUDA_LIBRARIES})

set(CUDAToolkit_VERSION "${CUDA_VERSION_STRING}")
set(CUDAToolkit_BIN_DIR "${CUDA_TOOLKIT_ROOT_DIR}/bin")
else()
message(STATUS "CUDA not found")
endif()
find_package(CUDAToolkit QUIET)
if(CUDAToolkit_FOUND)
set(CUDA_FOUND ON)
else()
find_package(CUDAToolkit QUIET)
if(CUDAToolkit_FOUND)
set(CUDA_FOUND ON)
enable_language(CUDA)
else()
message(STATUS "CUDA not found")
endif()
message(STATUS "CUDA not found")
endif()
endif()

Expand Down