File tree Expand file tree Collapse file tree 3 files changed +21
-0
lines changed Expand file tree Collapse file tree 3 files changed +21
-0
lines changed Original file line number Diff line number Diff line change 11import importlib
2+ import os
3+ import sys
24
35from .cv2 import *
46from .data import *
57
68# wildcard import above does not import "private" variables like __version__
79# this makes them available
810globals ().update (importlib .import_module ('cv2.cv2' ).__dict__ )
11+
12+ if sys .platform == 'darwin' :
13+ os .environ ['QT_QPA_PLATFORM_PLUGIN_PATH' ] = os .path .join (
14+ os .path .dirname (os .path .abspath (__file__ )), 'qt' , 'plugins'
15+ )
Original file line number Diff line number Diff line change 1+ diff --git a/opencv/CMakeLists.txt b/opencv/CMakeLists.txt
2+ index 8ccad4d03a..0d5e2a79e9 100644
3+ --- a/opencv/CMakeLists.txt
4+ +++ b/opencv/CMakeLists.txt
5+ @@ -1164,6 +1164,7 @@ if(WITH_QT OR HAVE_QT)
6+ if(HAVE_QT5)
7+ status(" QT:" "YES (ver ${Qt5Core_VERSION_STRING})")
8+ status(" QT OpenGL support:" HAVE_QT_OPENGL THEN "YES (${Qt5OpenGL_LIBRARIES} ${Qt5OpenGL_VERSION_STRING})" ELSE NO)
9+ + install(DIRECTORY ${Qt5_DIR}/../../../plugins DESTINATION lib/qt)
10+ elseif(HAVE_QT)
11+ status(" QT:" "YES (ver ${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}.${QT_VERSION_PATCH} ${QT_EDITION})")
12+ status(" QT OpenGL support:" HAVE_QT_OPENGL THEN "YES (${QT_QTOPENGL_LIBRARY})" ELSE NO)
Original file line number Diff line number Diff line change @@ -128,6 +128,7 @@ def main():
128128
129129 if sys .platform == 'darwin' and not build_headless :
130130 cmake_args .append ("-DWITH_QT=5" )
131+ rearrange_cmake_output_data ['cv2.qt.plugins.platforms' ] = [(r'lib/qt/plugins/platforms/libqcocoa\.dylib' )]
131132
132133 if build_headless :
133134 # it seems that cocoa cannot be disabled so on macOS the package is not truly headless
@@ -144,6 +145,7 @@ def main():
144145 # https://github.com/skvark/opencv-python/issues/21
145146 cmake_args .append ("-DCMAKE_CXX_FLAGS=-stdlib=libc++" )
146147 cmake_args .append ("-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.9" )
148+ subprocess .check_call ("patch -p1 < patches/patchQtPlugins" , shell = True )
147149
148150 if sys .platform .startswith ('linux' ):
149151 cmake_args .append ("-DWITH_IPP=OFF" ) # tests fail with IPP compiled with
You can’t perform that action at this time.
0 commit comments