Class: TorQMLBuilder

Inherits:
Object
  • Object
show all
Defined in:
ext/TorQML/FrameGrabber/extconf.rb

Instance Method Summary collapse

Instance Method Details

#buildObject



29
30
31
# File 'ext/TorQML/FrameGrabber/extconf.rb', line 29

def build
  sh("#{@make_bin}")
end

#build_allObject



33
34
35
36
37
38
# File 'ext/TorQML/FrameGrabber/extconf.rb', line 33

def build_all
  find_deps
  makefile &&
    qmake &&
    build
end

#find_depsObject



6
7
8
9
10
11
# File 'ext/TorQML/FrameGrabber/extconf.rb', line 6

def find_deps
  @pkgconfig_bin = with_config('pkg-config') || ENV['PKGCONFIG'] || find_executable('pkg-config')
  @qt_path = with_config('qt-dir') ? Pathname(with_config('qt-dir')).realpath : nil
  @make_bin = ENV['MAKE'] || find_executable('make')
  @qmake_bin = @qt_path ? @qt_path + 'bin/qmake' : find_executable('qmake')
end

#makefileObject



21
22
23
# File 'ext/TorQML/FrameGrabber/extconf.rb', line 21

def makefile
  sh("#{@qmake_bin}")
end

#qmakeObject



25
26
27
# File 'ext/TorQML/FrameGrabber/extconf.rb', line 25

def qmake
  sh("#{@make_bin} qmake")
end

#sh(command) ⇒ Object



13
14
15
16
17
18
19
# File 'ext/TorQML/FrameGrabber/extconf.rb', line 13

def sh(command)
  system(command)
  success = $?.exitstatus == 0
  puts "Command '#{command}' not found." if $?.exitstatus == 127
  puts "Command '#{command}' failed." unless success
  success
end