You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+83-9Lines changed: 83 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,15 +33,89 @@ updating the typesystems as well.
33
33
34
34
# Building
35
35
36
-
## Building on Windows with MinGW
36
+
## General
37
37
38
-
To build PythonQt, you need to set the environment variable `PYTHON_PATH` to
39
-
point to the root dir of the python installation. Then you should set the
40
-
`PYTHON_VERSION` variable to the Python version number.
38
+
Building PythonQt requires a couple of steps.
39
+
Follow these instructions in order to get a correctly built PythonQt runtime and Qt bindings.
41
40
42
-
When using the prebuild Python installer, this will be:
41
+
### Recommendations
43
42
44
-
```cmd
45
-
set PYTHON_PATH=c:\Python310
46
-
set PYTHON_VERSION=3.10
47
-
```
43
+
It is recommended to build the Qt bindings yourself instead of using the pregenerated ones.
44
+
This ensures the bindings are compatible with your Qt version.
45
+
Do not build `PythonQt.pro` directly because it will only use the pregenerated bindings!
46
+
47
+
### Environment
48
+
49
+
First, you need to set a couple of environment variables, which depend on your Python and Qt installation.
50
+
51
+
-`PYTHON_VERSION`
52
+
53
+
Set the version of your Python interpreter. The syntax is `<major>.<minor>`, e.g., `3.10`.
54
+
55
+
-`PYTHON_PATH`
56
+
57
+
This is the absolute path to the root directory of your Python installation.
58
+
59
+
-`PYTHON_LIB`
60
+
61
+
The absolute path to the `libs` directory in your python installation `$PYTHON_PATH/libs`.
62
+
63
+
-`PYTHON_DIR`
64
+
65
+
The `PYTHON_DIR` is required for non-Windows installations to find the `python-config` executable.
66
+
This should have the same value as `PYTHON_PATH`.
67
+
68
+
-`QTDIR`
69
+
70
+
The absolute path to the root directory of your Qt installation.
71
+
72
+
### Binding Generator
73
+
74
+
1. cd into the `generator` directory
75
+
2. Run qmake on `generator.pro`
76
+
77
+
`qmake CONFIG+=Release generator.pro`
78
+
79
+
3. Make the generator
80
+
81
+
Use `nmake` for MSVC (Visual Studio; make sure to have the environment variables set for Visual Studio beforehand). Otherwise, use `make`.
82
+
83
+
4. Generate the bindings
84
+
85
+
We use the generator executable from step 3 to generate the bindings.
86
+
The location of the generator executable can vary depending on your platform (the subdirectory is named after the current configuration, e.g., `release`).
87
+
On Windows, the generator is named `pythonqt_generator.exe`; on all other platforms, it is named `pythonqt_generator`.
0 commit comments