11import os
2+ import sys
23
34from pyqtbuild import PyQtBindings , PyQtProject
45from sipbuild import Option
@@ -16,12 +17,37 @@ def __init__(self, project):
1617 """ Initialise the bindings. """
1718
1819 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
1936
2037 def apply_user_defaults (self , tool ):
2138 """ Set default values for user options that haven't been set yet. """
22-
39+
2340 resource_file = os .path .join (self .project .root_dir ,'src' ,'ads.qrc' )
2441 print ("Adding resource file to qmake project: " , resource_file )
2542 self .builder_settings .append ('RESOURCES += ' + resource_file )
2643
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+
2753 super ().apply_user_defaults (tool )
0 commit comments