window-management-rpc: Client for testing out grpc proxy
[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 dep_qtappfw = [
6     dependency('qtappfw-weather'),
7 ]
8
9 grpcpp_reflection_dep = cpp.find_library('grpc++_reflection')
10 protoc = find_program('protoc')
11 grpc_cpp = find_program('grpc_cpp_plugin')
12
13 protoc_gen = generator(protoc, \
14                        output : ['@BASENAME@.pb.cc', '@BASENAME@.pb.h'],
15                        arguments : ['--proto_path=@CURRENT_SOURCE_DIR@/',
16                          '--cpp_out=@BUILD_DIR@',
17                          '@INPUT@'])
18
19 generated_protoc_sources = protoc_gen.process('agl_shell.proto')
20
21 grpc_gen = generator(protoc, \
22                      output : ['@BASENAME@.grpc.pb.cc', '@BASENAME@.grpc.pb.h'],
23                      arguments : ['--proto_path=@CURRENT_SOURCE_DIR@/',
24                        '--grpc_out=@BUILD_DIR@',
25                        '--plugin=protoc-gen-grpc=' + grpc_cpp.path(),
26                        '@INPUT@'])
27 generated_grpc_sources = grpc_gen.process('agl_shell.proto')
28
29 grpc_deps = [
30     dependency('protobuf'),
31     dependency('grpc'),
32     dependency('grpc++'),
33     grpcpp_reflection_dep,
34 ]
35
36 window_mgnt_dep = [
37     qt5_dep,
38     dep_qtappfw,
39     grpc_deps,
40 ]
41
42 window_mgnt_resources = [
43   'qml/images/images.qrc',
44   'qml/qml.qrc'
45 ]
46
47 resource_files = qt5.compile_resources(sources: window_mgnt_resources)
48
49 window_mgnt_src_headers = [
50   'AglShellGrpcClient.h',
51 ]
52
53 moc_files = qt5.compile_moc(headers: window_mgnt_src_headers,
54                             dependencies: qt5_dep)
55 window_mgnt_src = [
56   'AglShellGrpcClient.cpp',
57   'main.cpp',
58   generated_protoc_sources,
59   generated_grpc_sources,
60 ]
61
62 prefix_path = get_option('prefix')
63 binplugin_dir = join_paths(prefix_path, get_option('bindir'))
64
65 executable('window-management-rpc', window_mgnt_src, resource_files, moc_files,
66             dependencies : window_mgnt_dep,
67             install_rpath: binplugin_dir,
68             install: true)