Skip to content

Commit 08f7f13

Browse files
authored
Merge pull request opencv#26234 from zachlowry:apply-gcc6-fix-on-each-directory
Move the gcc6 compatibility check to occur on a per-directory basis, … opencv#26234 Proposed fix for opencv#26233 opencv#26233 ### Pull Request Readiness Checklist See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [x] The PR is proposed to the proper branch - [x] There is a reference to the original bug report and related work - [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [ ] The feature is well documented and sample code can be built with the project CMake
1 parent 0f23420 commit 08f7f13

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

cmake/OpenCVUtils.cmake

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -353,23 +353,23 @@ function(ocv_target_include_directories target)
353353
#ocv_debug_message("ocv_target_include_directories(${target} ${ARGN})")
354354
_ocv_fix_target(target)
355355
set(__params "")
356-
if(CV_GCC AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0" AND
357-
";${ARGN};" MATCHES "/usr/include;")
358-
return() # workaround for GCC 6.x bug
359-
endif()
360-
set(__params "")
361356
set(__system_params "")
362357
set(__var_name __params)
363358
foreach(dir ${ARGN})
364359
if("${dir}" STREQUAL "SYSTEM")
365360
set(__var_name __system_params)
366361
else()
367-
get_filename_component(__abs_dir "${dir}" ABSOLUTE)
368-
ocv_is_opencv_directory(__is_opencv_dir "${dir}")
369-
if(__is_opencv_dir)
370-
list(APPEND ${__var_name} "${__abs_dir}")
362+
if(CV_GCC AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0" AND
363+
dir MATCHES "/usr/include$")
364+
# workaround for GCC 6.x bug
371365
else()
372-
list(APPEND ${__var_name} "${dir}")
366+
get_filename_component(__abs_dir "${dir}" ABSOLUTE)
367+
ocv_is_opencv_directory(__is_opencv_dir "${dir}")
368+
if(__is_opencv_dir)
369+
list(APPEND ${__var_name} "${__abs_dir}")
370+
else()
371+
list(APPEND ${__var_name} "${dir}")
372+
endif()
373373
endif()
374374
endif()
375375
endforeach()

0 commit comments

Comments
 (0)