microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS
MIT License
22k stars 6.12k forks source link

opencv2[cuda]:x64-windows OpenCVConfig.cmake error #24242

Closed ericCHxia closed 3 weeks ago

ericCHxia commented 2 years ago

Describe the bug <opencv2/opencv.hpp> can't be found by IDE. But everything is ok when I built it without cuda. And I fix it when I delete the two lines in the OpenCVConfig.cmake.

# if(NOT WIN32 OR ANDROID)
  if(ANDROID)
    set(OpenCV_INSTALL_PATH "${OpenCV_CONFIG_PATH}/../../..")
  else()
    set(OpenCV_INSTALL_PATH "${OpenCV_CONFIG_PATH}/../..")
  endif()
  # Get the absolute path with no ../.. relative marks, to eliminate implicit linker warnings
  if(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} VERSION_LESS 2.8)
    get_filename_component(OpenCV_INSTALL_PATH "${OpenCV_INSTALL_PATH}" ABSOLUTE)
  else()
    get_filename_component(OpenCV_INSTALL_PATH "${OpenCV_INSTALL_PATH}" REALPATH)
  endif()
# endif()

Environment

JackBoosY commented 2 years ago

cc @cenit

cenit commented 2 years ago

I cannot reproduce the issue, for me both opencv2[default-features] and opencv2[cuda] work ok in a downstream project. Also, I cannot see why CUDA could be an issue from the snippet above.

github-actions[bot] commented 4 months ago

This is an automated message. Per our repo policy, stale issues get closed if there has been no activity in the past 180 days. The issue will be automatically closed in 14 days. If you wish to keep this issue open, please add a new comment.