Debian Codegraph @

cmake/modules/FindPyQt6.py

raw symbols SCIP
1 # SPDX-FileCopyrightText: 2014 Simon Edwards <[email protected]>
2 # SPDX-FileCopyrightText: 2021 L. E. Segovia <[email protected]>
3 #
4 # SPDX-License-Identifier: BSD-3-Clause
5 #
6
7 import re
8 import sys
9 import os
10 import sysconfig
11
12 try:
13 # On Windows and Python 3.8+ python doesn't load module DLL's
14 # from the current PATH environment, therefore we should add
15 # path to Qt's DLL's manually. This variable is passed from
16 # FindPyQt6.cmake
17 for path in os.environ['PYTHONDLLPATH'].split(';'):
18 os.add_dll_directory(path)
19 except:
20 pass
21
22 import PyQt6.QtCore
23
24 print("pyqt_version:%06.0x" % PyQt6.QtCore.PYQT_VERSION)
25 print("pyqt_version_str:%s" % PyQt6.QtCore.PYQT_VERSION_STR)
26
27 pyqt_version_tag = ""
28 in_t = False
29
30 # If we use a system install with a custom PYTHONPATH, PyQt6
31 # may not be within the system tree.
32 pyqt6_dir = os.path.dirname(PyQt6.__file__)
33 lib_site_packages = sysconfig.get_path('platlib')
34 # Check this first.
35 if pyqt6_dir.startswith(lib_site_packages):
36 pyqt_sip_dir = os.path.join(sysconfig.get_path('platlib'), "PyQt6", "bindings")
37 else:
38 # If so, change it.
39 pyqt_sip_dir = os.path.join(pyqt6_dir, "bindings")
40
41 print("pyqt_sip_dir:%s" % pyqt_sip_dir)