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: 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, #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) ⇒ Qt

Returns a new instance of Qt.



19
20
21
22
# File 'lib/build-tool/build-system/qt.rb', line 19

def initialize( *args )
    super( *args )
    @supported_options << 'flags'
end

Instance Method Details

#_configure(command, wd = build_directory) ⇒ Object

Execute a cmake command in the context of the build directory



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

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



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

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

#configureObject



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

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)


29
30
31
# File 'lib/build-tool/build-system/qt.rb', line 29

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

#install(fast) ⇒ Object



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

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

#install_fast_supported?Boolean

Returns:

  • (Boolean)


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

def install_fast_supported?
    true
end

#make(target = nil) ⇒ Object



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

def make( target = nil )
    Make.make( "#{target ? target : "" }", build_directory, self.module.environment.values )
end

#nameObject



33
34
35
# File 'lib/build-tool/build-system/qt.rb', line 33

def name
    "qt"
end

#reconfigureObject

Configure the module



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

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