Class: BuildTool::BuildSystem::QMake

Inherits:
Base
  • Object
show all
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

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

#configureObject



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

Returns:

  • (Boolean)


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

Returns:

  • (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

#nameObject



31
32
33
# File 'lib/build-tool/build-system/qmake.rb', line 31

def name
    "qmake"
end

#option_stringObject



73
74
75
76
77
78
79
80
# File 'lib/build-tool/build-system/qmake.rb', line 73

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



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

#reconfigureObject

Configure the module



40
41
42
# File 'lib/build-tool/build-system/qmake.rb', line 40

def reconfigure()
    configure
end