From 913b3ee817a34bd78d5a8dc4fc9025920202db09 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Tue, 4 Dec 2018 23:38:48 +0200 Subject: Overhaul the directory structure In order to match the directory structure of traditional projects, rename the top-level lib/ directory to src/libcamera/. Other libraries developed as part of the project will later find a home in src/. Split the libcamera header files in three categories: public headers describing the public API in include/libcamera/, internal headers describing the internal API in src/libcamera/include/, and private headers local to one or a small number of compilation units along the corresponding .cpp files. As no internal header exists yet the src/libcamera/include/ directory is created empty as the build system would fail otherwise. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- lib/main.cpp | 17 ----------------- lib/meson.build | 6 ------ meson.build | 4 ++-- src/libcamera/include/.keep_empty | 0 src/libcamera/main.cpp | 17 +++++++++++++++++ src/libcamera/meson.build | 11 +++++++++++ src/meson.build | 1 + test/meson.build | 2 +- 8 files changed, 32 insertions(+), 26 deletions(-) delete mode 100644 lib/main.cpp delete mode 100644 lib/meson.build create mode 100644 src/libcamera/include/.keep_empty create mode 100644 src/libcamera/main.cpp create mode 100644 src/libcamera/meson.build create mode 100644 src/meson.build diff --git a/lib/main.cpp b/lib/main.cpp deleted file mode 100644 index 0059e0c9..00000000 --- a/lib/main.cpp +++ /dev/null @@ -1,17 +0,0 @@ -/* SPDX-License-Identifier: LGPL-2.1-or-later */ -/* - * Copyright (C) 2018, Google Inc. - * - * main.cpp - libcamera main class - */ - -#include -#include - -using std::cout; -using std::endl; - -void libcamera::init_lib(void) -{ - cout << "Lib Camera Init" << endl; -} diff --git a/lib/meson.build b/lib/meson.build deleted file mode 100644 index fcd738cc..00000000 --- a/lib/meson.build +++ /dev/null @@ -1,6 +0,0 @@ -sources = ['main.cpp'] - -libcamera = shared_library('camera', - sources, - install : true, - include_directories : inc) diff --git a/meson.build b/meson.build index e0aeefa3..e6ed03f9 100644 --- a/meson.build +++ b/meson.build @@ -21,11 +21,11 @@ cpp_arguments = common_arguments add_project_arguments(c_arguments, language: 'c') add_project_arguments(cpp_arguments, language: 'cpp') -inc = include_directories('include') +libcamera_includes = include_directories('include') subdir('Documentation') subdir('include') -subdir('lib') +subdir('src') subdir('test') subdir('utils') diff --git a/src/libcamera/include/.keep_empty b/src/libcamera/include/.keep_empty new file mode 100644 index 00000000..e69de29b diff --git a/src/libcamera/main.cpp b/src/libcamera/main.cpp new file mode 100644 index 00000000..0059e0c9 --- /dev/null +++ b/src/libcamera/main.cpp @@ -0,0 +1,17 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2018, Google Inc. + * + * main.cpp - libcamera main class + */ + +#include +#include + +using std::cout; +using std::endl; + +void libcamera::init_lib(void) +{ + cout << "Lib Camera Init" << endl; +} diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build new file mode 100644 index 00000000..07d9cd44 --- /dev/null +++ b/src/libcamera/meson.build @@ -0,0 +1,11 @@ +sources = ['main.cpp'] + +includes = [ + libcamera_includes, + include_directories('include'), +] + +libcamera = shared_library('camera', + sources, + install : true, + include_directories : includes) diff --git a/src/meson.build b/src/meson.build new file mode 100644 index 00000000..4ce9668c --- /dev/null +++ b/src/meson.build @@ -0,0 +1 @@ +subdir('libcamera') diff --git a/test/meson.build b/test/meson.build index afe9bd9a..924a26f1 100644 --- a/test/meson.build +++ b/test/meson.build @@ -1,5 +1,5 @@ test_init = executable('test_init', 'init.cpp', link_with : libcamera, - include_directories : inc) + include_directories : libcamera_includes) test('Initialisation test', test_init) -- cgit v1.2.1