diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2022-10-20 00:44:55 +0300 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2022-10-20 13:36:25 +0300 |
commit | 84ad104499d9efc0253dae1a60ee070ed375ad95 (patch) | |
tree | d10fd53eb79cebb28fa3f72b18b46dddb6382b83 /src/apps/qcam/meson.build | |
parent | daf3f4b59f4ea0ecb42c6a39fe909f071d3a2842 (diff) |
Move test applications to src/apps/
The cam and qcam test application share code, currently through a crude
hack that references the cam source files directly from the qcam
meson.build file. To prepare for the introduction of hosting that code
in a static library, move all applications to src/apps/.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src/apps/qcam/meson.build')
-rw-r--r-- | src/apps/qcam/meson.build | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/src/apps/qcam/meson.build b/src/apps/qcam/meson.build new file mode 100644 index 00000000..d5916d0d --- /dev/null +++ b/src/apps/qcam/meson.build @@ -0,0 +1,83 @@ +# SPDX-License-Identifier: CC0-1.0 + +qt5 = import('qt5') +qt5_dep = dependency('qt5', + method : 'pkg-config', + modules : ['Core', 'Gui', 'Widgets'], + required : get_option('qcam'), + version : '>=5.4') + +if not qt5_dep.found() + qcam_enabled = false + subdir_done() +endif + +qcam_enabled = true + +qcam_sources = files([ + '../cam/image.cpp', + '../cam/options.cpp', + '../cam/stream_options.cpp', + 'cam_select_dialog.cpp', + 'format_converter.cpp', + 'main.cpp', + 'main_window.cpp', + 'message_handler.cpp', + 'viewfinder_qt.cpp', +]) + +qcam_moc_headers = files([ + 'cam_select_dialog.h', + 'main_window.h', + 'viewfinder_qt.h', +]) + +qcam_resources = files([ + 'assets/feathericons/feathericons.qrc', +]) + +qt5_cpp_args = ['-DQT_NO_KEYWORDS'] + +tiff_dep = dependency('libtiff-4', required : false) +if tiff_dep.found() + qt5_cpp_args += ['-DHAVE_TIFF'] + qcam_sources += files([ + '../cam/dng_writer.cpp', + ]) +endif + +if cxx.has_header_symbol('QOpenGLWidget', 'QOpenGLWidget', + dependencies : qt5_dep, args : '-fPIC') + qcam_sources += files([ + 'viewfinder_gl.cpp', + ]) + qcam_moc_headers += files([ + 'viewfinder_gl.h', + ]) + qcam_resources += files([ + 'assets/shader/shaders.qrc' + ]) +endif + +# gcc 9 introduced a deprecated-copy warning that is triggered by Qt until +# Qt 5.13. clang 10 introduced the same warning, but detects more issues +# that are not fixed in Qt yet. Disable the warning manually in both cases. +if ((cc.get_id() == 'gcc' and cc.version().version_compare('>=9.0') and + qt5_dep.version().version_compare('<5.13')) or + (cc.get_id() == 'clang' and cc.version().version_compare('>=10.0'))) + qt5_cpp_args += ['-Wno-deprecated-copy'] +endif + +resources = qt5.preprocess(moc_headers: qcam_moc_headers, + qresources : qcam_resources, + dependencies: qt5_dep) + +qcam = executable('qcam', qcam_sources, resources, + install : true, + dependencies : [ + libatomic, + libcamera_public, + qt5_dep, + tiff_dep, + ], + cpp_args : qt5_cpp_args) |