[libcamera-devel,2/2] include: Install include files

Message ID 20181126140111.13255-3-kieran.bingham@ideasonboard.com
State Accepted
Headers show
Series
  • library install targets
Related show

Commit Message

Kieran Bingham Nov. 26, 2018, 2:01 p.m. UTC
The include directory was defined but not installed.

Add it to the meson build structure to incorporate it as part of the
library install.

To facilitate the same include paths in our internal includes, update
the structure for headers to match the install structure.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

---

DESTDIR=/tmp/install/libcamera ninja install

/tmp/install/libcamera/
└── usr
    └── local
        ├── include
        │   └── libcamera
        │       └── libcamera.h
        ├── lib
        │   └── x86_64-linux-gnu
        │       ├── libcamera.so
        │       └── pkgconfig
        │           └── camera.pc
        └── share
            └── doc
                └── libcamera-0.1
                    └── html

 include/{ => libcamera}/libcamera.h | 0
 include/libcamera/meson.build       | 6 ++++++
 include/meson.build                 | 1 +
 meson.build                         | 1 +
 test/init.cpp                       | 2 +-
 5 files changed, 9 insertions(+), 1 deletion(-)
 rename include/{ => libcamera}/libcamera.h (100%)
 create mode 100644 include/libcamera/meson.build
 create mode 100644 include/meson.build

Comments

Laurent Pinchart Nov. 27, 2018, 1:22 a.m. UTC | #1
Hi Kieran,

Thank you for the patch.

On Monday, 26 November 2018 16:01:11 EET Kieran Bingham wrote:
> The include directory was defined but not installed.
> 
> Add it to the meson build structure to incorporate it as part of the
> library install.
> 
> To facilitate the same include paths in our internal includes, update
> the structure for headers to match the install structure.
> 
> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> 
> ---
> 
> DESTDIR=/tmp/install/libcamera ninja install
> 
> /tmp/install/libcamera/
> └── usr
>     └── local
>         ├── include
>         │   └── libcamera
>         │       └── libcamera.h
>         ├── lib
>         │   └── x86_64-linux-gnu
>         │       ├── libcamera.so
>         │       └── pkgconfig
>         │           └── camera.pc
>         └── share
>             └── doc
>                 └── libcamera-0.1
>                     └── html
> 
>  include/{ => libcamera}/libcamera.h | 0
>  include/libcamera/meson.build       | 6 ++++++
>  include/meson.build                 | 1 +
>  meson.build                         | 1 +
>  test/init.cpp                       | 2 +-
>  5 files changed, 9 insertions(+), 1 deletion(-)
>  rename include/{ => libcamera}/libcamera.h (100%)
>  create mode 100644 include/libcamera/meson.build
>  create mode 100644 include/meson.build
> 
> diff --git a/include/libcamera.h b/include/libcamera/libcamera.h
> similarity index 100%
> rename from include/libcamera.h
> rename to include/libcamera/libcamera.h
> diff --git a/include/libcamera/meson.build b/include/libcamera/meson.build
> new file mode 100644
> index 000000000000..d30356af112a
> --- /dev/null
> +++ b/include/libcamera/meson.build
> @@ -0,0 +1,6 @@
> +public_api = [
> +	'libcamera.h',
> +]
> +
> +install_headers(public_api,
> +		subdir : 'libcamera')

Is there any way to locate this file one folder up (in include/) and use 
wildcards for public_api ?

As commented for a previous patch, I'm still worried about using spaces and 
tabs for indentation.

The rest looks good to me, so with this fixed,

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> diff --git a/include/meson.build b/include/meson.build
> new file mode 100644
> index 000000000000..4ce9668caa7b
> --- /dev/null
> +++ b/include/meson.build
> @@ -0,0 +1 @@
> +subdir('libcamera')
> diff --git a/meson.build b/meson.build
> index 434aa557b8a1..494193483079 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -10,6 +10,7 @@ api_version = '0.1'
>  inc = include_directories('include')
> 
>  subdir('Documentation')
> +subdir('include')
>  subdir('lib')
>  subdir('test')
>  subdir('utils')
> diff --git a/test/init.cpp b/test/init.cpp
> index 182728d349a3..8c8ec9adfb83 100644
> --- a/test/init.cpp
> +++ b/test/init.cpp
> @@ -1,4 +1,4 @@
> -#include <libcamera.h>
> +#include <libcamera/libcamera.h>
> 
>  int main(void)
>  {
Kieran Bingham Nov. 27, 2018, 12:42 p.m. UTC | #2
On 27/11/2018 01:22, Laurent Pinchart wrote:
> Hi Kieran,
> 
> Thank you for the patch.
> 
> On Monday, 26 November 2018 16:01:11 EET Kieran Bingham wrote:
>> The include directory was defined but not installed.
>>
>> Add it to the meson build structure to incorporate it as part of the
>> library install.
>>
>> To facilitate the same include paths in our internal includes, update
>> the structure for headers to match the install structure.
>>
>> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
>>
>> ---
>>
>> DESTDIR=/tmp/install/libcamera ninja install
>>
>> /tmp/install/libcamera/
>> └── usr
>>     └── local
>>         ├── include
>>         │   └── libcamera
>>         │       └── libcamera.h
>>         ├── lib
>>         │   └── x86_64-linux-gnu
>>         │       ├── libcamera.so
>>         │       └── pkgconfig
>>         │           └── camera.pc
>>         └── share
>>             └── doc
>>                 └── libcamera-0.1
>>                     └── html
>>
>>  include/{ => libcamera}/libcamera.h | 0
>>  include/libcamera/meson.build       | 6 ++++++
>>  include/meson.build                 | 1 +
>>  meson.build                         | 1 +
>>  test/init.cpp                       | 2 +-
>>  5 files changed, 9 insertions(+), 1 deletion(-)
>>  rename include/{ => libcamera}/libcamera.h (100%)
>>  create mode 100644 include/libcamera/meson.build
>>  create mode 100644 include/meson.build
>>
>> diff --git a/include/libcamera.h b/include/libcamera/libcamera.h
>> similarity index 100%
>> rename from include/libcamera.h
>> rename to include/libcamera/libcamera.h
>> diff --git a/include/libcamera/meson.build b/include/libcamera/meson.build
>> new file mode 100644
>> index 000000000000..d30356af112a
>> --- /dev/null
>> +++ b/include/libcamera/meson.build
>> @@ -0,0 +1,6 @@
>> +public_api = [
>> +	'libcamera.h',
>> +]
>> +
>> +install_headers(public_api,
>> +		subdir : 'libcamera')
> 
> Is there any way to locate this file one folder up (in include/) and use 
> wildcards for public_api ?

No, I'm afraid wildcards aren't allowed, even in the install targets it
seems.

> 
> As commented for a previous patch, I'm still worried about using spaces and 
> tabs for indentation.

Replaced tabs for spaces.

> 
> The rest looks good to me, so with this fixed,
> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
>> diff --git a/include/meson.build b/include/meson.build
>> new file mode 100644
>> index 000000000000..4ce9668caa7b
>> --- /dev/null
>> +++ b/include/meson.build
>> @@ -0,0 +1 @@
>> +subdir('libcamera')
>> diff --git a/meson.build b/meson.build
>> index 434aa557b8a1..494193483079 100644
>> --- a/meson.build
>> +++ b/meson.build
>> @@ -10,6 +10,7 @@ api_version = '0.1'
>>  inc = include_directories('include')
>>
>>  subdir('Documentation')
>> +subdir('include')
>>  subdir('lib')
>>  subdir('test')
>>  subdir('utils')
>> diff --git a/test/init.cpp b/test/init.cpp
>> index 182728d349a3..8c8ec9adfb83 100644
>> --- a/test/init.cpp
>> +++ b/test/init.cpp
>> @@ -1,4 +1,4 @@
>> -#include <libcamera.h>
>> +#include <libcamera/libcamera.h>
>>
>>  int main(void)
>>  {
>

Patch

diff --git a/include/libcamera.h b/include/libcamera/libcamera.h
similarity index 100%
rename from include/libcamera.h
rename to include/libcamera/libcamera.h
diff --git a/include/libcamera/meson.build b/include/libcamera/meson.build
new file mode 100644
index 000000000000..d30356af112a
--- /dev/null
+++ b/include/libcamera/meson.build
@@ -0,0 +1,6 @@ 
+public_api = [
+	'libcamera.h',
+]
+
+install_headers(public_api,
+		subdir : 'libcamera')
diff --git a/include/meson.build b/include/meson.build
new file mode 100644
index 000000000000..4ce9668caa7b
--- /dev/null
+++ b/include/meson.build
@@ -0,0 +1 @@ 
+subdir('libcamera')
diff --git a/meson.build b/meson.build
index 434aa557b8a1..494193483079 100644
--- a/meson.build
+++ b/meson.build
@@ -10,6 +10,7 @@  api_version = '0.1'
 inc = include_directories('include')
 
 subdir('Documentation')
+subdir('include')
 subdir('lib')
 subdir('test')
 subdir('utils')
diff --git a/test/init.cpp b/test/init.cpp
index 182728d349a3..8c8ec9adfb83 100644
--- a/test/init.cpp
+++ b/test/init.cpp
@@ -1,4 +1,4 @@ 
-#include <libcamera.h>
+#include <libcamera/libcamera.h>
 
 int main(void)
 {