[libcamera-devel] [PATCH v1 1/2] libcamera: Fix base and ipa include dir

Laurent Pinchart laurent.pinchart at ideasonboard.com
Sun Sep 26 18:45:53 CEST 2021


All libcamera headers are meant to be installed in
${prefix}/include/libcamera/libcamera, with pkgconfig specifying the
include directory as `-I ${prefix}/include/libcamera`. Applications then
include the headers with `#include <libcamera/camera.h>`.

The base and ipa headers are meant to be installed in subdirectories of
the libcamera headers directory, but are mistakenly installed one level
too high, in ${prefix}/include/libcamera. This leads to compilation
failures when including the base or ipa header.

Fix this by setting the meson libcamera_include_dir variable to the
libcamera headers directory. All other header paths are derived from
that variable and are now correct.

Reported-by: Dorota Czaplejewicz <dorota.czaplejewicz at puri.sm>
Bug: https://bugs.libcamera.org/show_bug.cgi?id=79
Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
---
 include/libcamera/meson.build | 14 +++++++-------
 include/meson.build           |  2 --
 2 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/include/libcamera/meson.build b/include/libcamera/meson.build
index 5b25ef847ed4..567782a66ba3 100644
--- a/include/libcamera/meson.build
+++ b/include/libcamera/meson.build
@@ -1,5 +1,7 @@
 # SPDX-License-Identifier: CC0-1.0
 
+libcamera_include_dir = 'libcamera' / 'libcamera'
+
 libcamera_public_headers = files([
     'camera.h',
     'camera_manager.h',
@@ -16,14 +18,12 @@ libcamera_public_headers = files([
     'transform.h',
 ])
 
-include_dir = libcamera_include_dir / 'libcamera'
-
 subdir('base')
 subdir('internal')
 subdir('ipa')
 
 install_headers(libcamera_public_headers,
-                subdir : include_dir)
+                subdir : libcamera_include_dir)
 
 #
 # Generate headers from templates.
@@ -44,7 +44,7 @@ foreach header : control_source_files
                                      output : header + '.h',
                                      command : [gen_controls, '-o', '@OUTPUT@', '@INPUT@'],
                                      install : true,
-                                     install_dir : get_option('includedir') / include_dir)
+                                     install_dir : get_option('includedir') / libcamera_include_dir)
 endforeach
 
 libcamera_public_headers += control_headers
@@ -59,7 +59,7 @@ formats_h = custom_target('formats_h',
                           output : 'formats.h',
                           command : [gen_formats, '-o', '@OUTPUT@', '@INPUT@'],
                           install : true,
-                          install_dir : get_option('includedir') / include_dir)
+                          install_dir : get_option('includedir') / libcamera_include_dir)
 libcamera_public_headers += formats_h
 
 # libcamera.h
@@ -68,7 +68,7 @@ libcamera_h = custom_target('gen-header',
                             output : 'libcamera.h',
                             command : [gen_header, meson.current_source_dir(), '@OUTPUT@'],
                             install : true,
-                            install_dir : get_option('includedir') / include_dir)
+                            install_dir : get_option('includedir') / libcamera_include_dir)
 
 libcamera_public_headers += libcamera_h
 
@@ -82,4 +82,4 @@ libcamera_version_config.set('LIBCAMERA_VERSION_PATCH', version[2])
 configure_file(input : 'version.h.in',
                output : 'version.h',
                configuration : libcamera_version_config,
-               install_dir : get_option('includedir') / include_dir)
+               install_dir : get_option('includedir') / libcamera_include_dir)
diff --git a/include/meson.build b/include/meson.build
index 2ac9a3a049f2..27ce2f41c534 100644
--- a/include/meson.build
+++ b/include/meson.build
@@ -1,6 +1,4 @@
 # SPDX-License-Identifier: CC0-1.0
 
-libcamera_include_dir = 'libcamera'
-
 subdir('android')
 subdir('libcamera')
-- 
Regards,

Laurent Pinchart



More information about the libcamera-devel mailing list