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, #remove_source_directory, #set, #source_directory, #to_s
Constructor Details
#initialize(*args) ⇒ QMake
Returns a new instance of QMake.
18 19 20 |
# File 'lib/build-tool/build-system/qmake.rb', line 18 def initialize( *args ) super( *args ) end |
Instance Method Details
#configure ⇒ Object
53 54 55 56 57 58 59 |
# File 'lib/build-tool/build-system/qmake.rb', line 53 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
27 28 29 |
# File 'lib/build-tool/build-system/qmake.rb', line 27 def configured? Pathname.new( build_directory ).join( 'Makefile' ).exist? end |
#install(fast) ⇒ Object
61 62 63 |
# File 'lib/build-tool/build-system/qmake.rb', line 61 def install( fast ) make( "install" ) end |
#install_fast_supported? ⇒ Boolean
65 66 67 |
# File 'lib/build-tool/build-system/qmake.rb', line 65 def install_fast_supported? false end |
#make(target = nil) ⇒ Object
69 70 71 |
# File 'lib/build-tool/build-system/qmake.rb', line 69 def make( target = nil ) Make.make( "#{target ? target : "" }", build_directory, self.module.environment.values ) end |
#name ⇒ Object
31 32 33 |
# File 'lib/build-tool/build-system/qmake.rb', line 31 def name "qmake" end |
#option_string ⇒ Object
73 74 75 76 77 78 79 |
# File 'lib/build-tool/build-system/qmake.rb', line 73 def option_string arr = [] option_hash.each do |var, val| arr << "#{var}='#{val}'" end arr.join(" ") end |
#qmake(command, wd = build_directory) ⇒ Object
Execute a qmake command in the context of the build directory
45 46 47 48 49 50 51 |
# File 'lib/build-tool/build-system/qmake.rb', line 45 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
40 41 42 |
# File 'lib/build-tool/build-system/qmake.rb', line 40 def reconfigure() configure end |