[libcamera-devel] [PATCH v1 2/3] libcamera: Use get_option('includedir') instead of raw 'include'

Umang Jain umang.jain at ideasonboard.com
Fri Apr 30 14:37:09 CEST 2021


Hi Kieran,

On 4/30/21 5:46 PM, Kieran Bingham wrote:
> Hi Umang,
>
> On 30/04/2021 12:43, Umang Jain wrote:
>> In most cases, file paths in meson files start with get_option().
>> To maintain a consistent theme, use meson's get_option('includedir')
>> universal option over raw 'include'. This option is defaulted to
>> 'include' string value, hence this commit does not introduce any
>> functional changes.
>>
>> Signed-off-by: Umang Jain <umang.jain at ideasonboard.com>
>> ---
>>   include/libcamera/meson.build | 8 ++++----
>>   1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/include/libcamera/meson.build b/include/libcamera/meson.build
>> index 4a5b915e..086c958b 100644
>> --- a/include/libcamera/meson.build
>> +++ b/include/libcamera/meson.build
>> @@ -48,7 +48,7 @@ foreach header : control_source_files
>>                                        output : header + '.h',
>>                                        command : [gen_controls, '-o', '@OUTPUT@', '@INPUT@'],
>>                                        install : true,
>> -                                     install_dir : 'include' / include_dir)
>> +                                     install_dir : get_option('includedir') / include_dir)
> include_dir is currently defined as 'libcamera'.
No, in the same file -  include/libcamera/meson.build
include_dir = libcamera_include_dir / 'libcamera'

and

libcamera_include_dir = 'libcamera' from include/meson.build

so install dir comes to (with --prefix=/usr)
/usr/include/libcamera/libcamera/


Running a branch with these patches and running a master branch (with 
--prefix=/usr in both) confirms, the public headers are installed to 
/usr/include/libcamera/libcamera/


>
> Could we make this use the same style as the 'define system paths'
> patch, and also update this variable to become
>
> libcamera_includedir = get_option('includedir') / 'libcamera'
>
> and then use that as the install dir?
Can it be done on top? This patch is just to bring in get_option() style 
in for file paths as Laurent suggested earlier?
>
>
>
>
>>   endforeach
>>   
>>   libcamera_public_headers += control_headers
>> @@ -63,7 +63,7 @@ formats_h = custom_target('formats_h',
>>                             output : 'formats.h',
>>                             command : [gen_formats, '-o', '@OUTPUT@', '@INPUT@'],
>>                             install : true,
>> -                          install_dir : 'include' / include_dir)
>> +                          install_dir : get_option('includedir') / include_dir)
>>   libcamera_public_headers += formats_h
>>   
>>   # libcamera.h
>> @@ -72,7 +72,7 @@ libcamera_h = custom_target('gen-header',
>>                               output : 'libcamera.h',
>>                               command : [gen_header, meson.current_source_dir(), '@OUTPUT@'],
>>                               install : true,
>> -                            install_dir : 'include' / include_dir)
>> +                            install_dir : get_option('includedir') / include_dir)
>>   
>>   libcamera_public_headers += libcamera_h
>>   
>> @@ -86,4 +86,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 : 'include' / include_dir)
>> +               install_dir : get_option('includedir') / include_dir)
>>



More information about the libcamera-devel mailing list