aboutsummaryrefslogtreecommitdiff
path: root/share/include/qt4.bld
blob: 749cc529ec1e3798be3afa4829b7318cd44728ce (plain)
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96

function qt_uiToH()
{
	if "${UI_DIR}" == "" then
	{
		DIR = INPUT.dirName();
	}
	else
	{
		DIR = UI_DIR;
	}
	FILE = INPUT.fileName();
	OUTFILE = FILE.replace(".ui",".h");
	return "${DIR}/ui_${OUTFILE}";
}

rule "qt_ui"
{
	display "ui";
	input "*.ui";
	output INPUT.qt_uiToH();
	tag "headers";
	profile "build"
	{
		execute("${QTDIR}/bin/uic -o ${OUTPUT} ${INPUT}");
	}
}

function qt_qrcToCpp()
{
	if "${RCC_DIR}" == "" then
	{
		DIR = INPUT.dirName();
	}
	else
	{
		DIR = RCC_DIR;
	}
	FILE = INPUT.fileName();
	OUTFILE = FILE.replace(".qrc",".cpp");
	return "${DIR}/qrc_${OUTFILE}";
}

rule "qt_rcc"
{
	display "rcc";
	input "*.qrc";
	output INPUT.qt_qrcToCpp();
	profile "build"
	{
		NAME = INPUT.fileName().replace(".qrc","");
		execute("${QTDIR}/bin/rcc -name ${NAME} -o ${OUTPUT} ${INPUT}");
	}
}

function qt_isMocable()
{
	if INPUT.matches("*.h") then
	{
		if exists( INPUT ) then
		{
			if "$(grep Q_OBJECT ${INPUT})" != "" then
			{
				return true;
			}
		}
	}
	return false;
}

function qt_hToMocCpp()
{
	if "${MOC_DIR}" == "" then
	{
		DIR = INPUT.dirName();
	}
	else
	{
		DIR = MOC_DIR;
	}
	FILE = INPUT.fileName();
	OUTFILE = FILE.replace(".h",".cpp");
	return "${DIR}/moc_${OUTFILE}";
}

rule "qt_moc"
{
	display "moc";
	input qt_isMocable();
	output INPUT.qt_hToMocCpp();
	profile "build"
	{
		execute("${QTDIR}/bin/moc -o${OUTPUT} ${INPUT}");
	}
}