Files
KDDockWidgets/python/PyKDDockWidgets/__init__.py.cmake
Renato Araujo Oliveira Filho 1826d68841 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.
2021-09-25 11:02:18 +01:00

33 lines
956 B
CMake

#
# This file is part of KDDockWidgets.
#
# SPDX-FileCopyrightText: 2020-2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
# Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
#
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
#
# Contact KDAB at <info@kdab.com> for commercial licensing options.
#
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
# Create a alias for PySide module so we can use a single import in source files
import PySide@PYSIDE_MAJOR_VERSION@
sys.modules["PySide"] = PySide@PYSIDE_MAJOR_VERSION@
except Exception:
print("Failed to load PySide")
raise
setupLibraryPath()