Skip to content

Commit bf80c94

Browse files
committed
Merge pull request opencv#10481 from alalek:fix_10474
2 parents 22576f4 + ea5a3e5 commit bf80c94

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

cmake/OpenCVUtils.cmake

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -667,6 +667,21 @@ macro(ocv_list_filterout lst regex)
667667
endforeach()
668668
endmacro()
669669

670+
# filter matching elements from the list
671+
macro(ocv_list_filter lst regex)
672+
set(dst ${ARGN})
673+
if(NOT dst)
674+
set(dst ${lst})
675+
endif()
676+
set(__result ${${lst}})
677+
foreach(item ${__result})
678+
if(NOT item MATCHES "${regex}")
679+
list(REMOVE_ITEM __result "${item}")
680+
endif()
681+
endforeach()
682+
set(${dst} ${__result})
683+
endmacro()
684+
670685

671686
# stable & safe duplicates removal macro
672687
macro(ocv_list_unique __lst)

modules/python/bindings/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ endforeach()
2020
set(opencv_hdrs "")
2121
set(opencv_userdef_hdrs "")
2222
foreach(m ${OPENCV_PYTHON_MODULES})
23-
list(APPEND opencv_hdrs ${OPENCV_MODULE_${m}_HEADERS})
23+
ocv_list_filter(OPENCV_MODULE_${m}_HEADERS "${OPENCV_MODULE_${m}_LOCATION}/include" __hdrs)
24+
list(APPEND opencv_hdrs ${__hdrs})
2425
file(GLOB userdef_hdrs ${OPENCV_MODULE_${m}_LOCATION}/misc/python/pyopencv*.hpp)
2526
list(APPEND opencv_userdef_hdrs ${userdef_hdrs})
2627
endforeach(m)

0 commit comments

Comments
 (0)