libcamera: Simplify header install paths with shortcut variables

Create local install_dir meson variable to store the full path to the
installation directory for the libcamera and ipa headers. This shortens
lines and avoids duplicating calls to get_option('includedir').

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
Laurent Pinchart 2021-09-26 19:04:33 +03:00
parent ff6c50974a
commit c8c1d07cea
2 changed files with 10 additions and 6 deletions

View file

@ -13,6 +13,8 @@ install_headers(libcamera_ipa_headers,
libcamera_generated_ipa_headers = [] libcamera_generated_ipa_headers = []
ipa_headers_install_dir = get_option('includedir') / libcamera_ipa_include_dir
# #
# Prepare IPA/IPC generation components # Prepare IPA/IPC generation components
# #
@ -34,7 +36,7 @@ libcamera_generated_ipa_headers += custom_target('core_ipa_interface_h',
output : 'core_ipa_interface.h', output : 'core_ipa_interface.h',
depends : mojom_templates, depends : mojom_templates,
install : true, install : true,
install_dir : get_option('includedir') / libcamera_ipa_include_dir, install_dir : ipa_headers_install_dir,
command : [ command : [
mojom_generator, 'generate', mojom_generator, 'generate',
'-g', 'libcamera', '-g', 'libcamera',
@ -98,7 +100,7 @@ foreach file : ipa_mojom_files
output : name + '_ipa_interface.h', output : name + '_ipa_interface.h',
depends : mojom_templates, depends : mojom_templates,
install : true, install : true,
install_dir : get_option('includedir') / libcamera_ipa_include_dir, install_dir : ipa_headers_install_dir,
command : [ command : [
mojom_generator, 'generate', mojom_generator, 'generate',
'-g', 'libcamera', '-g', 'libcamera',

View file

@ -29,6 +29,8 @@ install_headers(libcamera_public_headers,
# Generate headers from templates. # Generate headers from templates.
# #
libcamera_headers_install_dir = get_option('includedir') / libcamera_include_dir
# control_ids.h and property_ids.h # control_ids.h and property_ids.h
control_source_files = [ control_source_files = [
'control_ids', 'control_ids',
@ -44,7 +46,7 @@ foreach header : control_source_files
output : header + '.h', output : header + '.h',
command : [gen_controls, '-o', '@OUTPUT@', '@INPUT@'], command : [gen_controls, '-o', '@OUTPUT@', '@INPUT@'],
install : true, install : true,
install_dir : get_option('includedir') / libcamera_include_dir) install_dir : libcamera_headers_install_dir)
endforeach endforeach
libcamera_public_headers += control_headers libcamera_public_headers += control_headers
@ -59,7 +61,7 @@ formats_h = custom_target('formats_h',
output : 'formats.h', output : 'formats.h',
command : [gen_formats, '-o', '@OUTPUT@', '@INPUT@'], command : [gen_formats, '-o', '@OUTPUT@', '@INPUT@'],
install : true, install : true,
install_dir : get_option('includedir') / libcamera_include_dir) install_dir : libcamera_headers_install_dir)
libcamera_public_headers += formats_h libcamera_public_headers += formats_h
# libcamera.h # libcamera.h
@ -68,7 +70,7 @@ libcamera_h = custom_target('gen-header',
output : 'libcamera.h', output : 'libcamera.h',
command : [gen_header, meson.current_source_dir(), '@OUTPUT@'], command : [gen_header, meson.current_source_dir(), '@OUTPUT@'],
install : true, install : true,
install_dir : get_option('includedir') / libcamera_include_dir) install_dir : libcamera_headers_install_dir)
libcamera_public_headers += libcamera_h libcamera_public_headers += libcamera_h
@ -82,4 +84,4 @@ libcamera_version_config.set('LIBCAMERA_VERSION_PATCH', version[2])
configure_file(input : 'version.h.in', configure_file(input : 'version.h.in',
output : 'version.h', output : 'version.h',
configuration : libcamera_version_config, configuration : libcamera_version_config,
install_dir : get_option('includedir') / libcamera_include_dir) install_dir : libcamera_headers_install_dir)