Class: BuildTool::BuildSystem::QMake
- Includes:
- MJ::Tools::SubProcess
- Defined in:
- lib/build-tool/build-system/qmake.rb
Overview
QMake build system.
Defined Under Namespace
Classes: QMakeError
Instance Attribute Summary
Attributes inherited from Base
#defaults, #feature, #module, #out_of_source
Instance Method Summary collapse
- #configure ⇒ Object
-
#configured? ⇒ Boolean
Check if the module is configured.
-
#initialize(*args) ⇒ QMake
constructor
A new instance of QMake.
- #install(fast) ⇒ Object
- #install_fast_supported? ⇒ Boolean
- #make(target = nil) ⇒ Object
- #name ⇒ Object
- #option_string ⇒ Object
-
#qmake(command, wd = build_directory) ⇒ Object
Execute a qmake command in the context of the build directory.
-
#reconfigure ⇒ Object
Configure the module.
Methods inherited from Base
#[], #[]=, #active?, #after_rebase, #append, #build_directory, #check_build_directory, #check_install_prefix, #dup, #env, #install_prefix, #option_hash, #option_names, #option_set?, #parent, #prepare_for_installation, #prepend, #progressbar, #recipe, #remove_build_directory, #set, #source_directory, #to_s
Constructor Details
#initialize(*args) ⇒ QMake
Returns a new instance of QMake.
16 17 18 |
# File 'lib/build-tool/build-system/qmake.rb', line 16 def initialize( *args ) super( *args ) end |
Instance Method Details
#configure ⇒ Object
51 52 53 54 55 56 57 |
# File 'lib/build-tool/build-system/qmake.rb', line 51 def configure check_build_directory( true ) opt = option_string opt += " PREFIX=#{install_prefix.to_s}" if install_prefix rc = qmake "#{source_directory}/*.pro #{opt}" rc end |
#configured? ⇒ Boolean
Check if the module is configured
25 26 27 |
# File 'lib/build-tool/build-system/qmake.rb', line 25 def configured? Pathname.new( build_directory ).join( 'Makefile' ).exist? end |
#install(fast) ⇒ Object
59 60 61 |
# File 'lib/build-tool/build-system/qmake.rb', line 59 def install( fast ) make( "install" ) end |
#install_fast_supported? ⇒ Boolean
63 64 65 |
# File 'lib/build-tool/build-system/qmake.rb', line 63 def install_fast_supported? false end |
#make(target = nil) ⇒ Object
67 68 69 |
# File 'lib/build-tool/build-system/qmake.rb', line 67 def make( target = nil ) Make.make( "#{target ? target : "" }", build_directory, self.module.environment.values ) end |
#name ⇒ Object
29 30 31 |
# File 'lib/build-tool/build-system/qmake.rb', line 29 def name "qmake" end |
#option_string ⇒ Object
71 72 73 74 75 76 77 78 |
# File 'lib/build-tool/build-system/qmake.rb', line 71 def option_string arr = [] option_names.each do |var| val = self[var] arr << "#{var}='#{val}'" end arr.join(" ") end |
#qmake(command, wd = build_directory) ⇒ Object
Execute a qmake command in the context of the build directory
43 44 45 46 47 48 49 |
# File 'lib/build-tool/build-system/qmake.rb', line 43 def qmake( command, wd = build_directory ) rc = self.class.execute "qmake #{command}", wd, env if rc != 0 raise QMakeError, "qmake failed with error #{rc}!" end rc end |
#reconfigure ⇒ Object
Configure the module
38 39 40 |
# File 'lib/build-tool/build-system/qmake.rb', line 38 def reconfigure() configure end |