require 'rake' require 'rake/tasklib' require 'rake/clean' require 'leaves/version' module Rake module Leaves class QmakeTask < TaskLib attr_accessor :spec attr_accessor :makefile def initialize @makefile = "Makefile" yield self if block_given? define end def define define_build task :compile => [:qmake] file_create @makefile do cmd = "qmake" cmd << " -spec #{@spec}" if @spec sh cmd end task :qmake => [@makefile] self end private def define_build if (/darwin/.match(RUBY_PLATFORM) && (@spec.nil? || @spec == 'macx-xcode')) require 'leaves/xcode' Rake::Leaves::XcodeTask.new else require 'leaves/gnu' Rake::Leaves::MakeTask.new do |make| make.do_not_configure = true end end end end end end