qmake is being found, now get the versions

This commit is contained in:
John Bintz 2011-09-09 15:56:24 -04:00
parent ade490ba14
commit f832228325

View File

@ -75,12 +75,12 @@ module Qt
end end
def qt_version_of(qmake_path) def qt_version_of(qmake_path)
$stderr.puts %x{#{qmake_path} -v}
Gem::Version.new(%x{#{qmake_path} -v}.lines.to_a[1][%r{Using Qt version ([^ ]+) },1]) Gem::Version.new(%x{#{qmake_path} -v}.lines.to_a[1][%r{Using Qt version ([^ ]+) },1])
end end
def best_qmake def best_qmake
if qmake_path = QMAKES.collect do |path| if qmake_path = QMAKES.collect do |path|
$stderr.puts path
result = nil result = nil
if qmake_path = get_exe_path(path) if qmake_path = get_exe_path(path)
if (qt_version = qt_version_of(qmake_path)) >= Gem::Version.create('4.7') if (qt_version = qt_version_of(qmake_path)) >= Gem::Version.create('4.7')
@ -113,10 +113,6 @@ module Qt
end end
def get_exe_path(command) def get_exe_path(command)
$stderr.puts command
$stderr.puts `bash -c 'which which 2>&1'`
$stderr.puts `bash -c 'which #{command} 2>&1'`
path = %x{which #{command}}.strip path = %x{which #{command}}.strip
path = nil if path == '' path = nil if path == ''
path path