Install library so into python module dir

We do the same a PySide and install the target library into the python
module this. This way the bindings can work without need to export
system paths.
This commit is contained in:
Renato Araujo Oliveira Filho
2021-09-24 12:34:41 -03:00
committed by Sergio Martins
parent dc1e5103e2
commit 1826d68841
3 changed files with 17 additions and 2 deletions

View File

@@ -10,9 +10,15 @@
#
import sys
import os
__all__ = ['KDDockWidgets']
def setupLibraryPath():
package_dir = os.path.abspath(os.path.dirname(__file__))
if sys.platform == 'win32':
os.add_dll_directory(package_dir)
# Preload PySide libraries to avoid missing libraries while loading KDDockWidgets
try:
from PySide@PYSIDE_MAJOR_VERSION@ import QtCore
@@ -22,3 +28,5 @@ try:
except Exception:
print("Failed to load PySide")
raise
setupLibraryPath()