[libcamera-devel] [PATCH] meson: summarise paths

Kieran Bingham kieran.bingham at ideasonboard.com
Fri Apr 30 13:21:13 CEST 2021


The IPAs are loaded from a defined location set as IPA_MODULE_DIR.
Further more, configuration files for both libcamera and IPAs are loaded
from paths defined during the meson configuration.

To make it easy to identify these locations for a given configuration,
present them as a 'paths' section in the meson summary.

Signed-off-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
---
This adds the following to the summary of the Meson configuration:

  Paths
    LIBCAMERA_DATA_DIR       : "/usr/share/libcamera"
    LIBCAMERA_SYSCONF_DIR    : "/etc/libcamera"
    IPA_CONFIG_DIR           : "/etc/libcamera/ipa:/usr/share/libcamera/ipa"
    IPA_MODULE_DIR           : "/usr/lib/x86_64-linux-gnu/libcamera"

(Paths configurable of course)

I wondered if we should print more of the defined system variables, but
I felt like most of that is internal, whereas these paths are relevant
to the users of the library to answer questions like:

 - Where are IPA's loaded from?
 - Where are configuration files read from?

 src/ipa/meson.build | 16 +++++++++++-----
 src/meson.build     | 12 ++++++++++--
 2 files changed, 21 insertions(+), 7 deletions(-)

diff --git a/src/ipa/meson.build b/src/ipa/meson.build
index b3f24f42f8af..29b2f0fdcac8 100644
--- a/src/ipa/meson.build
+++ b/src/ipa/meson.build
@@ -8,12 +8,18 @@ ipa_install_dir = libcamera_libdir
 ipa_data_dir = libcamera_datadir / 'ipa'
 ipa_sysconf_dir = libcamera_sysconfdir / 'ipa'
 
-config_h.set('IPA_CONFIG_DIR',
-             '"' + get_option('prefix') / ipa_sysconf_dir +
-             ':' + get_option('prefix') / ipa_data_dir + '"')
+IPA_CONFIG_DIR = ('"' + get_option('prefix') / ipa_sysconf_dir +
+                  ':' + get_option('prefix') / ipa_data_dir + '"')
 
-config_h.set('IPA_MODULE_DIR',
-             '"' + get_option('prefix') / ipa_install_dir + '"')
+IPA_MODULE_DIR = '"' + get_option('prefix') / ipa_install_dir + '"'
+
+config_h.set('IPA_CONFIG_DIR', IPA_CONFIG_DIR)
+config_h.set('IPA_MODULE_DIR', IPA_MODULE_DIR)
+
+summary({
+         'IPA_CONFIG_DIR' : IPA_CONFIG_DIR,
+         'IPA_MODULE_DIR' : IPA_MODULE_DIR,
+        }, section : 'Paths')
 
 subdir('libipa')
 
diff --git a/src/meson.build b/src/meson.build
index edb7ce14f7a6..219e0b0a2b70 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -5,8 +5,16 @@ libcamera_datadir = get_option('datadir') / 'libcamera'
 libcamera_libdir = get_option('libdir') / 'libcamera'
 libcamera_sysconfdir = get_option('sysconfdir') / 'libcamera'
 
-config_h.set('LIBCAMERA_DATA_DIR', '"' + get_option('prefix') / libcamera_datadir + '"')
-config_h.set('LIBCAMERA_SYSCONF_DIR', '"' + get_option('prefix') / libcamera_sysconfdir + '"')
+LIBCAMERA_DATA_DIR = '"' + get_option('prefix') / libcamera_datadir + '"'
+LIBCAMERA_SYSCONF_DIR = '"' + get_option('prefix') / libcamera_sysconfdir + '"'
+
+config_h.set('LIBCAMERA_DATA_DIR', LIBCAMERA_DATA_DIR)
+config_h.set('LIBCAMERA_SYSCONF_DIR', LIBCAMERA_SYSCONF_DIR)
+
+summary({
+          'LIBCAMERA_DATA_DIR' : LIBCAMERA_DATA_DIR,
+          'LIBCAMERA_SYSCONF_DIR' : LIBCAMERA_SYSCONF_DIR,
+        }, section : 'Paths')
 
 # Module Signing
 openssl = find_program('openssl', required : true)
-- 
2.25.1



More information about the libcamera-devel mailing list