['tensor_filter_tensorflow_core.cc'],
cpp_args: nnstreamer_base_args + ['-Wno-sign-compare'],
dependencies: [tf_dep, protobuf_dep, glib_dep, gst_dep],
- include_directories: nnstreamer_inc
+ include_directories: nnstreamer_inc,
+ install: true,
+ install_dir: subplugins_install_dir
)
tensor_filter_tfcore_dep = declare_dependency(link_with: tensor_filter_tfcore_lib)
['tensor_filter_tensorflow_lite_core.cc'],
cpp_args: nnstreamer_base_args + ['-Wno-sign-compare'],
dependencies: [tflite_dep, libpthread_dep, libdl_dep, glib_dep, gst_dep],
- include_directories: nnstreamer_inc
+ include_directories: nnstreamer_inc,
+ install: true,
+ install_dir: subplugins_install_dir
)
tensor_filter_tflitecore_dep = declare_dependency(link_with: tensor_filter_tflitecore_lib)
gst_api_verision = '1.0'
+# Set configuration
+nnstreamer_conf = configuration_data()
+nnstreamer_conf.set('VERSION', meson.project_version())
+
nnstreamer_inc = include_directories('gst/nnstreamer')
nnstreamer_sources = []
nnstreamer_base_args = []
+# Common headers to be installed
+nnstreamer_headers = [
+ 'gst/nnstreamer/tensor_common.h',
+ 'gst/nnstreamer/tensor_typedef.h',
+ 'gst/nnstreamer/tensor_filter_custom.h'
+]
+
+# Set install path
+nnstreamer_prefix = get_option('prefix')
+nnstreamer_libdir = join_paths(nnstreamer_prefix, get_option('libdir'))
+nnstreamer_bindir = join_paths(nnstreamer_prefix, get_option('bindir'))
+nnstreamer_includedir = join_paths(nnstreamer_prefix, get_option('includedir'))
+
+libs_install_dir = nnstreamer_libdir
+plugins_install_dir = join_paths(nnstreamer_libdir, 'gstreamer-' + gst_api_verision)
+subplugins_install_dir = nnstreamer_libdir
+examples_install_dir = nnstreamer_bindir
+
+nnstreamer_conf.set('PREFIX', nnstreamer_prefix)
+nnstreamer_conf.set('EXEC_PREFIX', nnstreamer_bindir)
+nnstreamer_conf.set('LIB_INSTALL_DIR', libs_install_dir)
+nnstreamer_conf.set('GST_INSTALL_DIR', plugins_install_dir)
+nnstreamer_conf.set('INCLUDE_INSTALL_DIR', nnstreamer_includedir)
+
# Dependencies
glib_dep = dependency('glib-2.0')
gst_dep = dependency('gstreamer-' + gst_api_verision)
nnstreamer_sources,
c_args: nnstreamer_base_args,
dependencies: [nnstreamer_base_deps, nnstreamer_extra_deps],
- include_directories: nnstreamer_inc
+ include_directories: nnstreamer_inc,
+ install: true,
+ install_dir: plugins_install_dir
)
nnstreamer_static = static_library('nnstreamer',
nnstreamer_sources,
c_args: nnstreamer_base_args,
dependencies: [nnstreamer_base_deps, nnstreamer_extra_deps],
- include_directories: nnstreamer_inc
+ include_directories: nnstreamer_inc,
+ install: true,
+ install_dir: libs_install_dir
)
nnstreamer_lib = nnstreamer_shared
nnstreamer_dep = declare_dependency(link_with: nnstreamer_lib)
+# Install headers into /{includedir}/nnstreamer
+install_headers(nnstreamer_headers,
+ subdir: 'nnstreamer'
+)
+
+configure_file(input: 'nnstreamer.pc.in', output: 'nnstreamer.pc',
+ install: true,
+ install_dir: join_paths(libs_install_dir, 'pkgconfig'),
+ configuration: nnstreamer_conf
+)
+
# Build nnstreamer examples
subdir('nnstreamer_example')
option('ENABLE_TEST', type: 'boolean', value: true)
option('ENABLE_TENSORFLOW_LITE', type: 'boolean', value: true)
option('ENABLE_TENSORFLOW', type: 'boolean', value: true)
+option('INSTALL_EXAMPLES', type: 'boolean', value: false)
dummyLSTM = shared_library('dummyLSTM',
'dummy_LSTM.c',
dependencies: [libm_dep],
- include_directories: nnstreamer_inc
+ include_directories: nnstreamer_inc,
+ install: get_option('INSTALL_EXAMPLES'),
+ install_dir: subplugins_install_dir
)
dummyRNN = shared_library('dummyRNN',
'dummy_RNN.c',
- include_directories: nnstreamer_inc
+ include_directories: nnstreamer_inc,
+ install: get_option('INSTALL_EXAMPLES'),
+ install_dir: subplugins_install_dir
)
nnstreamer_customfilter_average = shared_library('nnstreamer_customfilter_average',
'nnstreamer_customfilter_example_average.c',
- include_directories: nnstreamer_inc
+ include_directories: nnstreamer_inc,
+ install: get_option('INSTALL_EXAMPLES'),
+ install_dir: subplugins_install_dir
)
nnstreamer_customfilter_opencv_scaler = shared_library('nnstreamer_customfilter_opencv_scaler',
'nnstreamer_customfilter_opencv_scaler.cc',
dependencies: [glib_dep, opencv_dep],
- include_directories: nnstreamer_inc
+ include_directories: nnstreamer_inc,
+ install: get_option('INSTALL_EXAMPLES'),
+ install_dir: subplugins_install_dir
)
nnstreamer_customfilter_opencv_average = shared_library('nnstreamer_customfilter_opencv_average',
'nnstreamer_customfilter_opencv_average.cc',
dependencies: [glib_dep, opencv_dep],
- include_directories: nnstreamer_inc
+ include_directories: nnstreamer_inc,
+ install: get_option('INSTALL_EXAMPLES'),
+ install_dir: subplugins_install_dir
)
nnstreamer_customfilter_passthrough = shared_library('nnstreamer_customfilter_passthrough',
'nnstreamer_customfilter_example_passthrough.c',
- include_directories: nnstreamer_inc
+ include_directories: nnstreamer_inc,
+ install: get_option('INSTALL_EXAMPLES'),
+ install_dir: subplugins_install_dir
)
nnstreamer_customfilter_passthrough_variable = shared_library('nnstreamer_customfilter_passthrough_variable',
'nnstreamer_customfilter_example_passthrough_variable.c',
- include_directories: nnstreamer_inc
+ include_directories: nnstreamer_inc,
+ install: get_option('INSTALL_EXAMPLES'),
+ install_dir: subplugins_install_dir
)
nnstreamer_customfilter_scaler = shared_library('nnstreamer_customfilter_scaler',
'nnstreamer_customfilter_example_scaler.c',
dependencies: [glib_dep],
- include_directories: nnstreamer_inc
+ include_directories: nnstreamer_inc,
+ install: get_option('INSTALL_EXAMPLES'),
+ install_dir: subplugins_install_dir
)
nnstreamer_customfilter_scaler_allocator = shared_library('nnstreamer_customfilter_scaler_allocator',
'nnstreamer_customfilter_example_scaler_allocator.c',
dependencies: [glib_dep],
- include_directories: nnstreamer_inc
+ include_directories: nnstreamer_inc,
+ install: get_option('INSTALL_EXAMPLES'),
+ install_dir: subplugins_install_dir
)
nnstreamer_example_cam = executable('nnstreamer_example_cam',
'nnstreamer_example_cam.c',
- dependencies: [glib_dep, gst_dep]
+ dependencies: [glib_dep, gst_dep],
+ install: get_option('INSTALL_EXAMPLES'),
+ install_dir: examples_install_dir
)
nnstreamer_example_decoder_image_labelling = executable('nnstreamer_example_decoder_image_labelling',
'nnstreamer_example_decoder_image_labelling.c',
- dependencies: [glib_dep, gst_dep]
+ dependencies: [glib_dep, gst_dep],
+ install: get_option('INSTALL_EXAMPLES'),
+ install_dir: examples_install_dir
)
nnstreamer_example_filter = executable('nnstreamer_example_filter',
'nnstreamer_example_filter.c',
- dependencies: [glib_dep, gst_dep]
+ dependencies: [glib_dep, gst_dep],
+ install: get_option('INSTALL_EXAMPLES'),
+ install_dir: examples_install_dir
)
nnstreamer_example_filter_performance_profile = executable('nnstreamer_example_filter_performance_profile',
'nnstreamer_example_filter_performance_profile.c',
- dependencies: [glib_dep, gst_dep]
+ dependencies: [glib_dep, gst_dep],
+ install: get_option('INSTALL_EXAMPLES'),
+ install_dir: examples_install_dir
)
nnstreamer_example_object_detection = executable('nnstreamer_example_object_detection',
'nnstreamer_example_object_detection.cc',
dependencies: [glib_dep, gst_dep, gst_video_dep, cairo_dep, libm_dep],
- include_directories: nnstreamer_inc
+ include_directories: nnstreamer_inc,
+ install: get_option('INSTALL_EXAMPLES'),
+ install_dir: examples_install_dir
)
+
+if get_option('INSTALL_EXAMPLES')
+ install_data(['get_model.sh', 'gst-launch-object-detection.sh'],
+ install_dir: examples_install_dir
+ )
+endif
nnstreamer_sink_example = executable('nnstreamer_sink_example',
'nnstreamer_sink_example.c',
- dependencies: [glib_dep, gst_dep, gst_app_dep]
+ dependencies: [glib_dep, gst_dep, gst_app_dep],
+ install: get_option('INSTALL_EXAMPLES'),
+ install_dir: examples_install_dir
)
nnstreamer_sink_example_play = executable('nnstreamer_sink_example_play',
'nnstreamer_sink_example_play.c',
- dependencies: [glib_dep, gst_dep, gst_app_dep]
+ dependencies: [glib_dep, gst_dep, gst_app_dep],
+ install: get_option('INSTALL_EXAMPLES'),
+ install_dir: examples_install_dir
)