Merge pull request #25706 from cudawarped:fix_cuda_first_python_dep

`cuda`: Add missing python CUDA dependency when CUDA is a first class language
pull/25602/head
Alexander Smorkalov 7 months ago committed by GitHub
commit 2629688d11
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 10
      modules/python/python_loader.cmake

@ -68,8 +68,14 @@ if(DEFINED OPENCV_PYTHON_INSTALL_PATH)
endif()
set(CMAKE_PYTHON_BINARIES_PATH "${CMAKE_PYTHON_BINARIES_INSTALL_PATH}")
if (WIN32 AND HAVE_CUDA)
if (DEFINED CUDA_TOOLKIT_ROOT_DIR)
list(APPEND CMAKE_PYTHON_BINARIES_PATH "os.path.join(os.getenv('CUDA_PATH', '${CUDA_TOOLKIT_ROOT_DIR}'), 'bin')")
if (ENABLE_CUDA_FIRST_CLASS_LANGUAGE)
if (DEFINED CUDAToolkit_LIBRARY_ROOT)
list(APPEND CMAKE_PYTHON_BINARIES_PATH "os.path.join(os.getenv('CUDA_PATH', '${CUDAToolkit_LIBRARY_ROOT}'), 'bin')")
endif()
else()
if (DEFINED CUDA_TOOLKIT_ROOT_DIR)
list(APPEND CMAKE_PYTHON_BINARIES_PATH "os.path.join(os.getenv('CUDA_PATH', '${CUDA_TOOLKIT_ROOT_DIR}'), 'bin')")
endif()
endif()
endif()
string(REPLACE ";" ",\n " CMAKE_PYTHON_BINARIES_PATH "${CMAKE_PYTHON_BINARIES_PATH}")

Loading…
Cancel
Save