cmake: fix files order in Python bindings
authorAlexander Alekhin <alexander.a.alekhin@gmail.com>
Thu, 1 Apr 2021 09:48:50 +0000 (09:48 +0000)
committerAlexander Alekhin <alexander.a.alekhin@gmail.com>
Thu, 1 Apr 2021 09:48:50 +0000 (09:48 +0000)
- with changes backport from 4.x

modules/python/bindings/CMakeLists.txt

index 0505f1f03f696a1bd4daaf4ff838876bc23a11d9..442107b13512f4e9710259bff6d0c11b2c8d642a 100644 (file)
@@ -26,9 +26,18 @@ foreach(m ${OPENCV_PYTHON_MODULES})
       list(APPEND opencv_hdrs "${hdr}")
     endif()
   endforeach()
+
+  # both wrapping and C++ implementation
+  file(GLOB hdr2 ${OPENCV_MODULE_${m}_LOCATION}/misc/python/python_*.hpp)
+  list(SORT hdr2)
+  list(APPEND opencv_hdrs ${hdr2})
+  list(APPEND opencv_userdef_hdrs ${hdr2})
+
   file(GLOB hdr ${OPENCV_MODULE_${m}_LOCATION}/misc/python/shadow*.hpp)
+  list(SORT hdr)
   list(APPEND opencv_hdrs ${hdr})
   file(GLOB userdef_hdrs ${OPENCV_MODULE_${m}_LOCATION}/misc/python/pyopencv*.hpp)
+  list(SORT userdef_hdrs)
   list(APPEND opencv_userdef_hdrs ${userdef_hdrs})
 endforeach(m)