Class: BuildTool::BuildSystem::Qt

Inherits:
Base
  • Object
show all
Includes:
MJ::Tools::SubProcess
Defined in:
lib/build-tool/build-system/qt.rb

Defined Under Namespace

Classes: MakeError, QMakeError

Instance Attribute Summary

Attributes inherited from Base

#defaults, #feature, #module, #out_of_source

Instance Method Summary collapse

Methods inherited from Base

#[], #[]=, #active?, #append, #build_directory, #check_build_directory, #dup, #env, #initialize, #install_prefix, #option_hash, #option_names, #option_set?, #parent, #prepend, #recipe, #remove_build_directory, #set, #source_directory, #to_s

Constructor Details

This class inherits a constructor from BuildTool::BuildSystem::Base

Instance Method Details

#_configure(command, wd = build_directory) ⇒ Object

Execute a cmake command in the context of the build directory



36
37
38
39
40
41
42
# File 'lib/build-tool/build-system/qt.rb', line 36

def _configure( command, wd = build_directory )
    rc = self.class.execute "#{source_directory}/configure #{command}", wd, env
    if rc != 0
        raise QMakeError, "configure failed with error #{rc}!"
    end
    rc
end

#after_rebaseObject



44
45
46
47
48
# File 'lib/build-tool/build-system/qt.rb', line 44

def after_rebase
    if configured?
        rc = self.class.execute( "bin/syncqt", build_directory, self.module.environment.values )
    end
end

#configureObject



50
51
52
53
54
55
56
57
# File 'lib/build-tool/build-system/qt.rb', line 50

def configure
    check_build_directory( true )
    opt = ""
    opt += " -prefix #{install_prefix.to_s} " if install_prefix
    opt += self['flags']
    rc = _configure opt
    rc
end

#configured?Boolean

Check if the module is configured

Returns:

  • (Boolean)


23
24
25
# File 'lib/build-tool/build-system/qt.rb', line 23

def configured?
    Pathname.new( build_directory ).join( 'Makefile' ).exist?
end

#do_make(target = nil) ⇒ Object



59
60
61
62
63
64
65
# File 'lib/build-tool/build-system/qt.rb', line 59

def do_make( target = nil )
    rc = self.class.execute( "make #{target ? target : "" }", build_directory, self.module.environment.values )
    if rc != 0
        raise MakeError, "make #{target || "" } failed with error code #{rc}";
    end
    rc
end

#install(fast) ⇒ Object



67
68
69
# File 'lib/build-tool/build-system/qt.rb', line 67

def install( fast )
    make( "install" )
end

#install_fast_supported?Boolean

Returns:

  • (Boolean)


71
72
73
# File 'lib/build-tool/build-system/qt.rb', line 71

def install_fast_supported?
    true
end

#intitialize(*args) ⇒ Object



14
15
16
# File 'lib/build-tool/build-system/qt.rb', line 14

def intitialize( *args )
    super( *args )
end

#make(target = nil) ⇒ Object



75
76
77
# File 'lib/build-tool/build-system/qt.rb', line 75

def make( target = nil )
    do_make( target )
end

#nameObject



27
28
29
# File 'lib/build-tool/build-system/qt.rb', line 27

def name
    "qt"
end

#reconfigureObject

Configure the module



80
81
82
83
84
85
# File 'lib/build-tool/build-system/qt.rb', line 80

def reconfigure()
    if File.exist?( "#{build_directory}/.qmake.cache" )
        return false if self.class.execute( "rm -f #{build_directory}/.qmake.cache" ) != 0
    end
    configure
end