AglShellGrpcClient: Add support for split windows
[src/window-management-client-grpc.git] / src / meson.build
1 pkgconfig = import('pkgconfig')
2 cpp = meson.get_compiler('cpp')
3
4 qt5_dep = dependency('qt5', modules: ['Qml', 'Quick', 'Gui'])
5
6 grpcpp_reflection_dep = cpp.find_library('grpc++_reflection')
7 protoc = find_program('protoc')
8 grpc_cpp = find_program('grpc_cpp_plugin')
9
10 protoc_gen = generator(protoc, \
11                        output : ['@BASENAME@.pb.cc', '@BASENAME@.pb.h'],
12                        arguments : ['--proto_path=@CURRENT_SOURCE_DIR@/',
13                          '--cpp_out=@BUILD_DIR@',
14                          '@INPUT@'])
15
16 generated_protoc_sources = protoc_gen.process('agl_shell.proto')
17
18 grpc_gen = generator(protoc, \
19                      output : ['@BASENAME@.grpc.pb.cc', '@BASENAME@.grpc.pb.h'],
20                      arguments : ['--proto_path=@CURRENT_SOURCE_DIR@/',
21                        '--grpc_out=@BUILD_DIR@',
22                        '--plugin=protoc-gen-grpc=' + grpc_cpp.path(),
23                        '@INPUT@'])
24 generated_grpc_sources = grpc_gen.process('agl_shell.proto')
25
26 grpc_deps = [
27     dependency('protobuf'),
28     dependency('grpc'),
29     dependency('grpc++'),
30     grpcpp_reflection_dep,
31 ]
32
33 window_mgnt_dep = [
34     qt5_dep,
35     grpc_deps,
36 ]
37
38 window_mgnt_resources = [
39   'qml/images/images.qrc',
40   'qml/qml.qrc'
41 ]
42
43 resource_files = qt5.compile_resources(sources: window_mgnt_resources)
44
45 window_mgnt_src_headers = [
46   'AglShellGrpcClient.h',
47 ]
48
49 moc_files = qt5.compile_moc(headers: window_mgnt_src_headers,
50                             dependencies: qt5_dep)
51 window_mgnt_src = [
52   'AglShellGrpcClient.cpp',
53   'main.cpp',
54   generated_protoc_sources,
55   generated_grpc_sources,
56 ]
57
58 prefix_path = get_option('prefix')
59 binplugin_dir = join_paths(prefix_path, get_option('bindir'))
60
61 executable('window-management-rpc', window_mgnt_src, resource_files, moc_files,
62             dependencies : window_mgnt_dep,
63             install_rpath: binplugin_dir,
64             install: true)