diff --git a/.gitmodules b/.gitmodules index 7193d3b9..99476363 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,12 +1,15 @@ [submodule "opencv"] path = opencv url = https://github.com/opencv/opencv.git + branch = 5.x [submodule "opencv_contrib"] path = opencv_contrib url = https://github.com/opencv/opencv_contrib.git + branch = 5.x [submodule "multibuild"] path = multibuild url = https://github.com/multi-build/multibuild.git [submodule "opencv_extra"] path = opencv_extra url = https://github.com/opencv/opencv_extra.git + branch = 5.x diff --git a/opencv b/opencv index 03cedee0..3b1ec72c 160000 --- a/opencv +++ b/opencv @@ -1 +1 @@ -Subproject commit 03cedee0b0258875eafd1576b59d686ba805da7a +Subproject commit 3b1ec72cf5ab5949c8c9b2f421e897d7b3756570 diff --git a/opencv_contrib b/opencv_contrib index 67337620..712f9758 160000 --- a/opencv_contrib +++ b/opencv_contrib @@ -1 +1 @@ -Subproject commit 673376203b0a8371a31ec5e8f08910a9744c0f32 +Subproject commit 712f9758c57edcefa99fc5ff6674352decc3cf31 diff --git a/opencv_extra b/opencv_extra index 08fe33c7..0e3b933a 160000 --- a/opencv_extra +++ b/opencv_extra @@ -1 +1 @@ -Subproject commit 08fe33c733cabec70ffb6e5eac49708b073e5277 +Subproject commit 0e3b933aa762b28b54a40034c58f8c734f1ed759 diff --git a/pyproject.toml b/pyproject.toml index 71de7f9b..270a25d1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] requires = [ - "cmake>=3.1", + "cmake>=3.13", "numpy==1.13.3; python_version=='3.6' and platform_machine != 'aarch64' and platform_machine != 'arm64'", "numpy==1.17.0; python_version=='3.7' and platform_machine != 'aarch64' and platform_machine != 'arm64'", "numpy==1.17.5; python_version=='3.8' and platform_machine != 'aarch64' and platform_machine != 'arm64'", diff --git a/setup.py b/setup.py index 48d5a65f..12eac0d5 100644 --- a/setup.py +++ b/setup.py @@ -103,14 +103,13 @@ def main(): "cv2": ["*%s" % sysconfig.get_config_vars().get("SO"), "version.py"] + (["*.dll"] if os.name == "nt" else []) + ["LICENSE.txt", "LICENSE-3RD-PARTY.txt"], - "cv2.data": ["*.xml"], } # Files from CMake output to copy to package. # Path regexes with forward slashes relative to CMake install dir. rearrange_cmake_output_data = { "cv2": ( - [r"bin/opencv_videoio_ffmpeg\d{4}%s\.dll" % ("_64" if is64 else "")] + [r"bin/opencv_videoio_ffmpeg\d{3}%s\.dll" % ("_64" if is64 else "")] if os.name == "nt" else [] ) @@ -139,12 +138,6 @@ def main(): + [ r"python/cv2/py.typed" ] if sys.version_info >= (3, 6) else [] , - "cv2.data": [ # OPENCV_OTHER_INSTALL_PATH - ("etc" if os.name == "nt" else "share/opencv4") + r"/haarcascades/.*\.xml" - ], - "cv2.gapi": [ - "python/cv2" + r"/gapi/.*\.py" - ], "cv2.mat_wrapper": [ "python/cv2" + r"/mat_wrapper/.*\.py" ], @@ -164,11 +157,28 @@ def main(): files_outside_package_dir = {"cv2": ["LICENSE.txt", "LICENSE-3RD-PARTY.txt"]} ci_cmake_generator = ( - ["-G", "Visual Studio 14" + (" Win64" if is64 else "")] + ["-G", "Visual Studio 16"] if os.name == "nt" else ["-G", "Unix Makefiles"] ) + generator_variant = [] + if os.name == "nt": + if platform.machine() == "ARM64": + generator_variant = [ "-A", "ARM64", + # Emulated cmake requires following flags to correctly detect + # target architecture for windows/arm64 build + "-DOPENCV_WORKAROUND_CMAKE_20989=ON", + "-DCMAKE_SYSTEM_PROCESSOR=ARM64"] + elif is64: + generator_variant = ["-DCMAKE_GENERATOR_PLATFORM=x64"] + else: + generator_variant = ["-DCMAKE_GENERATOR_PLATFORM=Win32"] + + print("Generator variant: ", generator_variant) + + ci_cmake_generator = ci_cmake_generator + generator_variant + cmake_args = ( (ci_cmake_generator if is_CI_build else []) + [ @@ -197,18 +207,6 @@ def main(): "-DPYTHON3_LIMITED_API=ON", "-DBUILD_OPENEXR=ON", ] - + ( - # CMake flags for windows/arm64 build - ["-DCMAKE_GENERATOR_PLATFORM=ARM64", - # Emulated cmake requires following flags to correctly detect - # target architecture for windows/arm64 build - "-DOPENCV_WORKAROUND_CMAKE_20989=ON", - "-DCMAKE_SYSTEM_PROCESSOR=ARM64"] - if platform.machine() == "ARM64" and sys.platform == "win32" - # If it is not defined 'linker flags: /machine:X86' on Windows x64 - else ["-DCMAKE_GENERATOR_PLATFORM=x64"] if is64 and sys.platform == "win32" - else [] - ) + ( ["-DOPENCV_EXTRA_MODULES_PATH=" + os.path.abspath("opencv_contrib/modules")] if build_contrib @@ -285,7 +283,7 @@ def main(): install_requires=install_requires, python_requires=">=3.6", classifiers=[ - "Development Status :: 5 - Production/Stable", + "Development Status :: 5 - Alpha", "Environment :: Console", "Intended Audience :: Developers", "Intended Audience :: Education",