summaryrefslogtreecommitdiff
path: root/src/qcam/meson.build
blob: 5b877a84da85f7c5afced9500eab279acef7e9c9 (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
qcam_sources = files([
    'format_converter.cpp',
    'main.cpp',
    'main_window.cpp',
    '../cam/options.cpp',
    'qt_event_dispatcher.cpp',
    'viewfinder.cpp',
])

qcam_moc_headers = files([
    'main_window.h',
])

qcam_resources = files([
    'assets/feathericons/feathericons.qrc',
])

qt5 = import('qt5')
qt5_dep = dependency('qt5',
                     method : 'pkg-config',
                     modules : ['Core', 'Gui', 'Widgets'],
                     required : false)

if qt5_dep.found()
    qt5_cpp_args = [ '-DQT_NO_KEYWORDS' ]

    # gcc 9 introduced a deprecated-copy warning that is triggered by Qt until
    # Qt 5.13. Disable it manually.
    if cc.get_id() == 'gcc'
        gcc_version = cc.version().split('.')
        qt5_version = qt5_dep.version().split('.')
        if qt5_version[1].to_int() < 13 and gcc_version[0].to_int() >= 9
            qt5_cpp_args += [ '-Wno-deprecated-copy' ]
        endif
    endif

    resources = qt5.preprocess(moc_headers: qcam_moc_headers,
                               qresources : qcam_resources,
                               dependencies: qt5_dep)

    qcam  = executable('qcam', qcam_sources, resources,
                       install : true,
                       dependencies : [libcamera_dep, qt5_dep],
                       cpp_args : qt5_cpp_args)
endif