forked from dimv36/QCustomPlot-PyQt5
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfigure.py
More file actions
36 lines (32 loc) · 1.13 KB
/
configure.py
File metadata and controls
36 lines (32 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import os
import sys
try:
from sipconfig import Configuration, ModuleMakefile
except ImportError:
print('Could not import sipconfig module')
exit(1)
try:
from PyQt5.QtCore import PYQT_CONFIGURATION
except ImportError:
print('Could not import PyQt5 module')
exit(1)
# Get the PyQt configuration information.
config = Configuration()
# Should be detected automatically, but if not, override here
#config.platform = "win32-msvc2008"
# Get the extra SIP flags needed by the imported PyQt modules. Note that
# this normally only includes those flags (-x and -t) that relate to SIP's
# versioning system.
pyqt_sip_flags = PYQT_CONFIGURATION['sip_flags']
pyqt_sip_dir = '%s/PyQt5/' % config.default_sip_dir
# Run SIP to generate the code. Note that we tell SIP where to find the qt
# module's specification files using the -I flag.
command = " ".join([config.sip_bin, "-c", ".", "-o", "-I", pyqt_sip_dir, pyqt_sip_flags, "qcustomplot.sip"])
os.system(command)
print(command)
# Now we run qmake and build library
os.system('qmake')
if sys.platform == 'linux':
os.system('make')
elif sys.platform == 'windows':
os.system('nmake')