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. 6
      modules/python/python_loader.cmake

@ -68,10 +68,16 @@ if(DEFINED OPENCV_PYTHON_INSTALL_PATH)
endif()
set(CMAKE_PYTHON_BINARIES_PATH "${CMAKE_PYTHON_BINARIES_INSTALL_PATH}")
if (WIN32 AND HAVE_CUDA)
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}")
configure_file("${PYTHON_SOURCE_DIR}/package/template/config.py.in" "${__python_loader_install_tmp_path}/cv2/config.py" @ONLY)
install(FILES "${__python_loader_install_tmp_path}/cv2/config.py" DESTINATION "${OPENCV_PYTHON_INSTALL_PATH}/cv2/" COMPONENT python)

Loading…
Cancel
Save