Fixed import module for windows and python 3.7
create unit test
This commit is contained in:
committed by
Renato Araujo Oliveira Filho
parent
15b3843172
commit
71e5d8cc31
@@ -84,14 +84,16 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/__init__.py.cmake ${CMAKE_CURRENT_BIN
|
||||
install(
|
||||
FILES
|
||||
${CMAKE_CURRENT_BINARY_DIR}/__init__.py
|
||||
$<TARGET_LINKER_FILE:KDAB::kddockwidgets>
|
||||
$<TARGET_FILE:KDAB::kddockwidgets>
|
||||
DESTINATION
|
||||
${${PROJECT_NAME}_PYTHON_BINDINGS_INSTALL_PREFIX}
|
||||
)
|
||||
if(NOT WIN32)
|
||||
install(
|
||||
FILES $<TARGET_SONAME_FILE:KDAB::kddockwidgets>
|
||||
DESTINATION ${${PROJECT_NAME}_PYTHON_BINDINGS_INSTALL_PREFIX}
|
||||
FILES
|
||||
$<TARGET_LINKER_FILE:KDAB::kddockwidgets>
|
||||
$<TARGET_SONAME_FILE:KDAB::kddockwidgets>
|
||||
DESTINATION
|
||||
${${PROJECT_NAME}_PYTHON_BINDINGS_INSTALL_PREFIX}
|
||||
)
|
||||
endif()
|
||||
|
||||
@@ -16,8 +16,14 @@ __all__ = ['KDDockWidgets']
|
||||
|
||||
def setupLibraryPath():
|
||||
package_dir = os.path.abspath(os.path.dirname(__file__))
|
||||
if sys.platform == 'win32':
|
||||
if sys.platform != 'win32':
|
||||
return
|
||||
|
||||
if sys.version_info[0] == 3 and sys.version_info[1] >= 8:
|
||||
os.add_dll_directory(package_dir)
|
||||
return
|
||||
|
||||
os.environ['PATH'] = os.fspath(package_dir) + os.pathsep + os.environ['PATH']
|
||||
|
||||
# Preload PySide libraries to avoid missing libraries while loading KDDockWidgets
|
||||
try:
|
||||
@@ -30,3 +36,15 @@ except Exception:
|
||||
raise
|
||||
|
||||
setupLibraryPath()
|
||||
|
||||
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
Reference in New Issue
Block a user