From 85f9ac4e238d99314c801cc7e975259321f617b2 Mon Sep 17 00:00:00 2001 From: Junrou Nishida Date: Fri, 10 Jan 2025 20:48:56 +0900 Subject: [PATCH] Merge pull request #26713 from homuler:fix/build-ios-framework Ensure Obj-C header files are generated correctly if under /private/var #26713 Fix #26712 ### 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 - [ ] The PR is proposed to the proper branch - [ ] 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 --- modules/objc/generator/gen_objc.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/objc/generator/gen_objc.py b/modules/objc/generator/gen_objc.py index 71bdf0fb01..74c370e8bf 100755 --- a/modules/objc/generator/gen_objc.py +++ b/modules/objc/generator/gen_objc.py @@ -1662,7 +1662,9 @@ if __name__ == "__main__": h_files += [os.path.join(root, filename) for filename in fnmatch.filter(filenames, '*.h')] hpp_files += [os.path.join(root, filename) for filename in fnmatch.filter(filenames, '*.hpp')] srcfiles = h_files + hpp_files - srcfiles = [f for f in srcfiles if not re_bad.search(f.replace('\\', '/'))] + # Use relative paths to avoid being affected by the name of the parent directory. + # See https://github.com/opencv/opencv/issues/26712 + srcfiles = [f for f in srcfiles if not re_bad.search(os.path.relpath(f, module_location).replace('\\', '/'))] logging.info("\nFiles (%d):\n%s", len(srcfiles), pformat(srcfiles)) common_headers_fname = os.path.join(misc_location, 'filelist_common')