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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
|
// -*- c++ -*-
#include <libctor.h>
#include <filesystem>
#include <iostream>
#include <string>
#include <vector>
int execute(const std::string& command,
const std::vector<std::string>& args,
bool verbose = true);
namespace
{
BuildConfigurations myConfigs(const Settings& settings)
{
//
// Qookie main application
//
BuildConfiguration qookie =
{
.target = "qookie", // output filename
.sources = {
"src/qookie.cc",
"src/database.cc",
"src/database_gourmet.cc",
"src/database_krecipes.cc",
"src/database_qookie.cc",
"src/mainwindow.cc",
"src/viewer.cc",
"src/client.cc",
settings.builddir + "/moc_mainwindow.cc",
settings.builddir + "/moc_viewer.cc",
settings.builddir + "/moc_client.cc",
},
.flags = {
.cxxflags = {
"-fPIC",
"-Wall", "-Werror", "-Wextra",// "-Wconversion",
"-Wno-deprecated-copy",
"-g",
},
},
.externals = { "qt", "sqlite" },
};
//
// Moc generation for all configurations
//
BuildConfiguration mocs =
{
.sources = {
{ "src/mainwindow.h", "moc_mainwindow.cc"},
{ "src/viewer.h", "moc_viewer.cc"},
{ "src/client.h", "moc_client.cc"},
{ "src/qookie-cast-client.h", "moc_qookie-cast-client.cc"},
},
.function = [](const std::string& input,
const std::string& output,
const BuildConfiguration& config,
const Settings& settings)
{
return execute("/usr/bin/moc", {"-I../src", "-o", output, input},
settings.verbose > 0);
}
};
//
// Qookie-cast client
//
BuildConfiguration qookie_cast_client =
{
.target = "qookie-cast-client", // output filename
.sources = {
"src/qookie-cast-client.cc",
settings.builddir + "/moc_qookie-cast-client.cc",
},
.flags = {
.cxxflags = {
"-fPIC",
"-Wall", "-Werror", "-Wextra",// "-Wconversion",
"-Wno-deprecated-copy",
"-g",
},
},
.externals = {"qt"},
};
return { qookie, mocs, qookie_cast_client };
}
ExternalConfigurations ctorExtConfigs(const Settings& settings)
{
return
{
{
.name = "qt",
.external = ExternalManual{
.flags = {
.cxxflags = {
"-I/usr/include/qt5",
},
.ldflags = {
"-lQt5Core",
"-lQt5Network",
"-lQt5Gui",
"-lQt5Widgets",
},
},
},
},
{
.name = "sqlite",
.external = ExternalManual{
.flags = {
.ldflags = {
"-lsqlite3",
},
},
},
},
};
}
}
// Register callbacks
REG(myConfigs);
REG(ctorExtConfigs);
|