File: qpp

package info (click to toggle)
liblastfm 0.4.0~git20090710-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 808 kB
  • sloc: cpp: 7,614; ruby: 397; ansic: 108; makefile: 49; sh: 5
file content (42 lines) | stat: -rwxr-xr-x 933 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/ruby
# Creates a qmake .pro file for all valid SOURCES, HEADERS, FORMS and
# RESOURCES under each argument to ARGV as directories

cwd=File.dirname __FILE__
require 'find'
require File.expand_path(File.join(File.dirname(__FILE__), 'findsrc.rb'))

sources = Array.new
headers = Array.new
forms = Array.new
resources = Array.new

$findsrc_prune_pro=true

ARGV.each do |d|
  Dir.chdir d do
    findsrc do |path,ext|
      case ext
        when ".h"   then headers   << path
        when ".ui"  then forms     << path
        when ".qrc" then resources << path
        when ".cpp" then sources   << path
      end
    end
  end
end

def puts_section section, files
  return if files.empty?
  print section + " ="
  files.each do |filename|
    print " \\\n\t"
    print filename
  end
  puts
end

puts_section "SOURCES", sources
puts_section "HEADERS", headers
puts_section "FORMS", forms
puts_section "RESOURCES", resources