opencv-4.10.0-26234.patch 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. https://github.com/opencv/opencv/pull/26234
  2. From 6a4be763b2db5f26684204ddc7d06c02325c3917 Mon Sep 17 00:00:00 2001
  3. From: Zach Lowry <zachlowry@canvas-inc.com>
  4. Date: Tue, 1 Oct 2024 14:16:54 -0500
  5. Subject: [PATCH 1/2] move the gcc6 compatibility check to occur on a
  6. per-directory basis, rather than exclude all include paths when the list of
  7. paths contains /usr/include
  8. ---
  9. cmake/OpenCVUtils.cmake | 20 ++++++++++----------
  10. 1 file changed, 10 insertions(+), 10 deletions(-)
  11. diff --git a/cmake/OpenCVUtils.cmake b/cmake/OpenCVUtils.cmake
  12. index 94f87d9a1200..bb20a22f0606 100644
  13. --- a/cmake/OpenCVUtils.cmake
  14. +++ b/cmake/OpenCVUtils.cmake
  15. @@ -353,23 +353,23 @@ function(ocv_target_include_directories target)
  16. #ocv_debug_message("ocv_target_include_directories(${target} ${ARGN})")
  17. _ocv_fix_target(target)
  18. set(__params "")
  19. - if(CV_GCC AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0" AND
  20. - ";${ARGN};" MATCHES "/usr/include;")
  21. - return() # workaround for GCC 6.x bug
  22. - endif()
  23. - set(__params "")
  24. set(__system_params "")
  25. set(__var_name __params)
  26. foreach(dir ${ARGN})
  27. if("${dir}" STREQUAL "SYSTEM")
  28. set(__var_name __system_params)
  29. else()
  30. - get_filename_component(__abs_dir "${dir}" ABSOLUTE)
  31. - ocv_is_opencv_directory(__is_opencv_dir "${dir}")
  32. - if(__is_opencv_dir)
  33. - list(APPEND ${__var_name} "${__abs_dir}")
  34. + if(CV_GCC AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0" AND
  35. + "${dir}" MATCHES "/usr/include$")
  36. + # workaround for GCC 6.x bug
  37. else()
  38. - list(APPEND ${__var_name} "${dir}")
  39. + get_filename_component(__abs_dir "${dir}" ABSOLUTE)
  40. + ocv_is_opencv_directory(__is_opencv_dir "${dir}")
  41. + if(__is_opencv_dir)
  42. + list(APPEND ${__var_name} "${__abs_dir}")
  43. + else()
  44. + list(APPEND ${__var_name} "${dir}")
  45. + endif()
  46. endif()
  47. endif()
  48. endforeach()
  49. From fc01b270ee657e7afc2657b7a9e15766aa36faf0 Mon Sep 17 00:00:00 2001
  50. From: Zach Lowry <zachlowry@canvas-inc.com>
  51. Date: Wed, 2 Oct 2024 13:28:57 -0500
  52. Subject: [PATCH 2/2] use `dir MATCHES ...` without variable unpacking
  53. ---
  54. cmake/OpenCVUtils.cmake | 2 +-
  55. 1 file changed, 1 insertion(+), 1 deletion(-)
  56. diff --git a/cmake/OpenCVUtils.cmake b/cmake/OpenCVUtils.cmake
  57. index bb20a22f0606..5886f4f3cb33 100644
  58. --- a/cmake/OpenCVUtils.cmake
  59. +++ b/cmake/OpenCVUtils.cmake
  60. @@ -360,7 +360,7 @@ function(ocv_target_include_directories target)
  61. set(__var_name __system_params)
  62. else()
  63. if(CV_GCC AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0" AND
  64. - "${dir}" MATCHES "/usr/include$")
  65. + dir MATCHES "/usr/include$")
  66. # workaround for GCC 6.x bug
  67. else()
  68. get_filename_component(__abs_dir "${dir}" ABSOLUTE)