1
1
import os
2
+ import sys
2
3
3
4
from pyqtbuild import PyQtBindings , PyQtProject
4
5
from sipbuild import Option
@@ -16,12 +17,37 @@ def __init__(self, project):
16
17
""" Initialise the bindings. """
17
18
18
19
super ().__init__ (project , 'ads' )
20
+
21
+ def get_options (self ):
22
+ """Our custom options that a user can pass to sip-build."""
23
+ options = super ().get_options ()
24
+ options += [
25
+ Option ('ads_incdir' ,
26
+ help = 'the directory containing the ads header file' ,
27
+ metavar = 'DIR' ),
28
+ Option ('ads_libdir' ,
29
+ help = 'the directory containing the ads library' ,
30
+ metavar = 'DIR' ),
31
+ Option ('ads_lib' ,
32
+ help = 'the ads library' ,
33
+ metavar = 'LIB' ),
34
+ ]
35
+ return options
19
36
20
37
def apply_user_defaults (self , tool ):
21
38
""" Set default values for user options that haven't been set yet. """
22
-
39
+
23
40
resource_file = os .path .join (self .project .root_dir ,'src' ,'ads.qrc' )
24
41
print ("Adding resource file to qmake project: " , resource_file )
25
42
self .builder_settings .append ('RESOURCES += ' + resource_file )
26
43
44
+ if self .ads_lib is not None :
45
+ self .libraries .append (self .ads_lib )
46
+
47
+ if self .ads_incdir is not None :
48
+ self .include_dirs .append (self .ads_incdir )
49
+
50
+ if self .ads_libdir is not None :
51
+ self .library_dirs .append (self .ads_libdir )
52
+
27
53
super ().apply_user_defaults (tool )
0 commit comments