Code : v4.3.0
--------------------------
1. Use CMake, drag CMakefileList.txt
2. Pre-build VTK, Specify VTK build directory in Ungrouped entries
3. Click Configure, wait
(a) Tick WITH/"WITH_QT"
Tick BUILD/Build_opencv_world, to generate only 1 lib, else many libs gen.
(b) Untick OPENCV/OPENCV_ENABLE_ALLOCATOR_STATS, or else below problem occur
gcc: error: long: No such file or directory
C:\mingw64\bin\windres.exe: preprocessing failed.
mingw32-make[2]: *** [modules\core\CMakeFiles\opencv_core.dir\build.make:1506: modules/core/CMakeFiles/opencv_core.dir/vs_version.rc.obj] Error 1
mingw32-make[2]: *** Waiting for unfinished jobs....
mingw32-make[1]: *** [CMakeFiles\Makefile2:2237: modules/core/CMakeFiles/opencv_core.dir/all] Error 2
mingw32-make: *** [Makefile:179: all] Error 2
(c) If you have already compiled zlib, jpeg, png, tiff, protobuf, you can untick in BUILD group, then specify the path after "Configure" step.
(d) in group, fill OPENCV/OPENCV_EXTRA_MODULE_PATH value : D:/__WORK__/01_CodeDev/OpenSource/OpenCV/code/opencv-4.3.0/opencv_contrib/modules
4. Generate, then build: mingw32-make -j8
5. If problem occur when build cv_version.rc, COmmand line too long, then move the OpenCV directory to D:/OpenCV, then build.
6. The OpenCV requires python 3.2, but if you PC installs Python 2.7, please untick python items in BUILD group