File tree 3 files changed +21
-0
lines changed
3 files changed +21
-0
lines changed Original file line number Diff line number Diff line change 1
1
import importlib
2
+ import os
3
+ import sys
2
4
3
5
from .cv2 import *
4
6
from .data import *
5
7
6
8
# wildcard import above does not import "private" variables like __version__
7
9
# this makes them available
8
10
globals ().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():
128
128
129
129
if sys .platform == 'darwin' and not build_headless :
130
130
cmake_args .append ("-DWITH_QT=5" )
131
+ rearrange_cmake_output_data ['cv2.qt.plugins.platforms' ] = [(r'lib/qt/plugins/platforms/libqcocoa\.dylib' )]
131
132
132
133
if build_headless :
133
134
# it seems that cocoa cannot be disabled so on macOS the package is not truly headless
@@ -144,6 +145,7 @@ def main():
144
145
# https://github.com/skvark/opencv-python/issues/21
145
146
cmake_args .append ("-DCMAKE_CXX_FLAGS=-stdlib=libc++" )
146
147
cmake_args .append ("-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.9" )
148
+ subprocess .check_call ("patch -p1 < patches/patchQtPlugins" , shell = True )
147
149
148
150
if sys .platform .startswith ('linux' ):
149
151
cmake_args .append ("-DWITH_IPP=OFF" ) # tests fail with IPP compiled with
You can’t perform that action at this time.
0 commit comments