From: sewon.oh Date: Thu, 29 Nov 2018 08:08:31 +0000 (+0900) Subject: [meson] add meson.build for example apps and custom filter X-Git-Tag: v0.0.3~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8ec24ba81173dfe10c35a7abe983bd3d182125ba;p=platform%2Fupstream%2Fnnstreamer.git [meson] add meson.build for example apps and custom filter For ssat and example, add meson.build Signed-off-by: sewon.oh --- diff --git a/gst/tensor_decoder/meson.build b/gst/tensor_decoder/meson.build index c9e7551..c30da6e 100644 --- a/gst/tensor_decoder/meson.build +++ b/gst/tensor_decoder/meson.build @@ -1,7 +1,9 @@ tensor_decoder_sources = [ - 'tensordec.c', - 'tensordec-plugins.c', - 'tensordec-directvideo.c' + 'tensordec.c', + 'tensordec-plugins.c', + 'tensordec-directvideo.c', + 'tensordec-imagelabel.c', + 'tensordec-boundingbox.c' ] tensor_decoderOBJ = static_library('tensor_decoder', diff --git a/gst/tensor_filter/meson.build b/gst/tensor_filter/meson.build index c17719c..953e3f9 100644 --- a/gst/tensor_filter/meson.build +++ b/gst/tensor_filter/meson.build @@ -3,12 +3,49 @@ tensor_filter_sources = [ 'tensor_filter_custom.c' ] +c_args = [] + +if get_option('ENABLE_TENSORFLOW_LITE') + tensor_filter_sources += 'tensor_filter_tensorflow_lite.c' + dependencies += dependency('tensorflow-lite') + c_args += '-DENABLE_TENSORFLOW_LITE' + + tensor_filter_tflitecoreOBJ = static_library('tensor_filter_tflitecore', + 'tensor_filter_tensorflow_lite_core.cc', + dependencies: [ + dependencies + ], + include_directories: inc, + cpp_args: '-Wno-sign-compare' + ).extract_all_objects() + + objects += tensor_filter_tflitecoreOBJ +endif + +if get_option('ENABLE_TENSORFLOW') + tensor_filter_sources += 'tensor_filter_tensorflow.c' + dependencies += dependency('tensorflow') + c_args += '-DENABLE_TENSORFLOW' + + tensor_filter_tfcoreOBJ = static_library('tensor_filter_tfcore', + 'tensor_filter_tensorflow_core.cc', + dependencies: [ + dependencies + ], + include_directories: inc, + cpp_args: '-Wno-sign-compare' + ).extract_all_objects() + + objects += tensor_filter_tflitecoreOBJ +endif + tensor_filterOBJ = static_library('tensor_filter', tensor_filter_sources, dependencies: [ dependencies ], - include_directories: inc + include_directories: inc, + c_args: c_args ).extract_all_objects() objects += tensor_filterOBJ diff --git a/meson.build b/meson.build index aef023f..97ad9e1 100644 --- a/meson.build +++ b/meson.build @@ -13,7 +13,6 @@ project('nnstreamer', 'c', 'cpp', ) add_project_arguments('-DVERSION="'+meson.project_version()+'"', language: 'c') -add_project_arguments('-DSINGLE_BINARY', language: 'c') gst_api_verision = '1.0' @@ -25,6 +24,7 @@ gstreamer_video = dependency('gstreamer-video-' + gst_api_verision) gstreamer_audio = dependency('gstreamer-audio-' + gst_api_verision) cc = meson.get_compiler('c') +cxx = meson.get_compiler('cpp') dependencies = [ glib, @@ -35,7 +35,8 @@ dependencies = [ gstreamer_audio, # required 'false' mean is used only when needed. cc.find_library('m', required: false), # cmath library - cc.find_library('dl', required: false) # DL library + cc.find_library('dl', required: false), # DL library + cxx.find_library('pthread', required: false) # pthread for tensor_filter_tensorflow_lite ] inc = include_directories('gst/nnstreamer') @@ -62,6 +63,12 @@ foreach p : projects subdir('gst/'+ p) endforeach +subdir('nnstreamer_example') + +if get_option('ENABLE_TEST') + subdir('tests') +endif + nnstreamer_sources = [ 'gst/nnstreamer/nnstreamer.c' ] diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 0000000..d7358c6 --- /dev/null +++ b/meson_options.txt @@ -0,0 +1,3 @@ +option('ENABLE_TEST', type: 'boolean', value: true) +option('ENABLE_TENSORFLOW_LITE', type: 'boolean', value: true) +option('ENABLE_TENSORFLOW', type: 'boolean', value: false) diff --git a/nnstreamer_example/custom_example_LSTM/meson.build b/nnstreamer_example/custom_example_LSTM/meson.build new file mode 100644 index 0000000..75065df --- /dev/null +++ b/nnstreamer_example/custom_example_LSTM/meson.build @@ -0,0 +1,8 @@ +dummyLSTM = shared_library('dummyLSTM', + 'dummy_LSTM.c', + dependencies: [ + dependencies + ], + include_directories: inc, + objects: objects +) diff --git a/nnstreamer_example/custom_example_RNN/meson.build b/nnstreamer_example/custom_example_RNN/meson.build new file mode 100644 index 0000000..6076c0d --- /dev/null +++ b/nnstreamer_example/custom_example_RNN/meson.build @@ -0,0 +1,8 @@ +dummyRNN = shared_library('dummyRNN', + 'dummy_RNN.c', + dependencies: [ + dependencies + ], + include_directories: inc, + objects: objects +) diff --git a/nnstreamer_example/custom_example_average/meson.build b/nnstreamer_example/custom_example_average/meson.build new file mode 100644 index 0000000..d897c5e --- /dev/null +++ b/nnstreamer_example/custom_example_average/meson.build @@ -0,0 +1,8 @@ +nnstreamer_customfilter_average = shared_library('nnstreamer_customfilter_average', + 'nnstreamer_customfilter_example_average.c', + dependencies: [ + dependencies + ], + include_directories: inc, + objects: objects +) diff --git a/nnstreamer_example/custom_example_opencv/meson.build b/nnstreamer_example/custom_example_opencv/meson.build new file mode 100644 index 0000000..556227f --- /dev/null +++ b/nnstreamer_example/custom_example_opencv/meson.build @@ -0,0 +1,19 @@ +dependencies += dependency('opencv') + +nnstreamer_customfilter_opencv_scaler = shared_library('nnstreamer_customfilter_opencv_scaler', + 'nnstreamer_customfilter_opencv_scaler.cc', + dependencies: [ + dependencies + ], + include_directories: inc, + objects: objects +) + +nnstreamer_customfilter_opencv_average = shared_library('nnstreamer_customfilter_opencv_average', + 'nnstreamer_customfilter_opencv_average.cc', + dependencies: [ + dependencies + ], + include_directories: inc, + objects: objects +) diff --git a/nnstreamer_example/custom_example_passthrough/meson.build b/nnstreamer_example/custom_example_passthrough/meson.build new file mode 100644 index 0000000..012f51c --- /dev/null +++ b/nnstreamer_example/custom_example_passthrough/meson.build @@ -0,0 +1,17 @@ +nnstreamer_customfilter_passthrough = shared_library('nnstreamer_customfilter_passthrough', + 'nnstreamer_customfilter_example_passthrough.c', + dependencies: [ + dependencies + ], + include_directories: inc, + objects: objects +) + +nnstreamer_customfilter_passthrough_variable = shared_library('nnstreamer_customfilter_passthrough_variable', + 'nnstreamer_customfilter_example_passthrough_variable.c', + dependencies: [ + dependencies + ], + include_directories: inc, + objects: objects +) diff --git a/nnstreamer_example/custom_example_scaler/meson.build b/nnstreamer_example/custom_example_scaler/meson.build new file mode 100644 index 0000000..0ab3344 --- /dev/null +++ b/nnstreamer_example/custom_example_scaler/meson.build @@ -0,0 +1,17 @@ +nnstreamer_customfilter_scaler = shared_library('nnstreamer_customfilter_scaler', + 'nnstreamer_customfilter_example_scaler.c', + dependencies: [ + dependencies + ], + include_directories: inc, + objects: objects +) + +nnstreamer_customfilter_scaler_allocator = shared_library('nnstreamer_customfilter_scaler_allocator', + 'nnstreamer_customfilter_example_scaler_allocator.c', + dependencies: [ + dependencies + ], + include_directories: inc, + objects: objects +) diff --git a/nnstreamer_example/example_cam/meson.build b/nnstreamer_example/example_cam/meson.build new file mode 100644 index 0000000..12325f4 --- /dev/null +++ b/nnstreamer_example/example_cam/meson.build @@ -0,0 +1,7 @@ +nnstreamer_example_cam = executable('nnstreamer_example_cam', + 'nnstreamer_example_cam.c', + dependencies: [ + dependencies + ], + include_directories: inc +) diff --git a/nnstreamer_example/example_decoder_image_labelling/meson.build b/nnstreamer_example/example_decoder_image_labelling/meson.build new file mode 100644 index 0000000..70079c9 --- /dev/null +++ b/nnstreamer_example/example_decoder_image_labelling/meson.build @@ -0,0 +1,7 @@ +nnstreamer_example_decoder_image_labelling = executable('nnstreamer_example_decoder_image_labelling', + 'nnstreamer_example_decoder_image_labelling.c', + dependencies: [ + dependencies + ], + include_directories: inc +) diff --git a/nnstreamer_example/example_filter/meson.build b/nnstreamer_example/example_filter/meson.build new file mode 100644 index 0000000..b658927 --- /dev/null +++ b/nnstreamer_example/example_filter/meson.build @@ -0,0 +1,7 @@ +nnstreamer_example_filter = executable('nnstreamer_example_filter', + 'nnstreamer_example_filter.c', + dependencies: [ + dependencies + ], + include_directories: inc +) diff --git a/nnstreamer_example/example_filter_performance_profile/meson.build b/nnstreamer_example/example_filter_performance_profile/meson.build new file mode 100644 index 0000000..834824f --- /dev/null +++ b/nnstreamer_example/example_filter_performance_profile/meson.build @@ -0,0 +1,7 @@ +nnstreamer_example_filter_performance_profile = executable('nnstreamer_example_filter_performance_profile', + 'nnstreamer_example_filter_performance_profile.c', + dependencies: [ + dependencies + ], + include_directories: inc +) diff --git a/nnstreamer_example/example_object_detection/meson.build b/nnstreamer_example/example_object_detection/meson.build new file mode 100644 index 0000000..717f562 --- /dev/null +++ b/nnstreamer_example/example_object_detection/meson.build @@ -0,0 +1,9 @@ +dependencies += dependency('cairo') + +nnstreamer_example_object_detection = executable('nnstreamer_example_object_detection', + 'nnstreamer_example_object_detection.cc', + dependencies: [ + dependencies + ], + include_directories: inc +) diff --git a/nnstreamer_example/example_sink/meson.build b/nnstreamer_example/example_sink/meson.build new file mode 100644 index 0000000..f7b0bf2 --- /dev/null +++ b/nnstreamer_example/example_sink/meson.build @@ -0,0 +1,15 @@ +nnstreamer_sink_example = executable('nnstreamer_sink_example', + 'nnstreamer_sink_example.c', + dependencies: [ + dependencies + ], + include_directories: inc +) + +nnstreamer_sink_example_play = executable('nnstreamer_sink_example_play', + 'nnstreamer_sink_example_play.c', + dependencies: [ + dependencies + ], + include_directories: inc +) diff --git a/nnstreamer_example/meson.build b/nnstreamer_example/meson.build new file mode 100644 index 0000000..4300f3f --- /dev/null +++ b/nnstreamer_example/meson.build @@ -0,0 +1,17 @@ +gstreamer_app = dependency('gstreamer-app-' + gst_api_verision) + +dependencies += gstreamer_app + +subdir('custom_example_passthrough') +subdir('custom_example_scaler') +subdir('custom_example_average') +subdir('custom_example_opencv') +subdir('custom_example_RNN') +subdir('custom_example_LSTM') + +subdir('example_cam') +subdir('example_sink') +subdir('example_filter') +subdir('example_object_detection') +subdir('example_decoder_image_labelling') +subdir('example_filter_performance_profile') diff --git a/tests/meson.build b/tests/meson.build new file mode 100644 index 0000000..389daf1 --- /dev/null +++ b/tests/meson.build @@ -0,0 +1 @@ +subdir('nnstreamer_tensors/tensors_test') diff --git a/tests/nnstreamer_tensors/tensors_test/meson.build b/tests/nnstreamer_tensors/tensors_test/meson.build new file mode 100644 index 0000000..38c80c6 --- /dev/null +++ b/tests/nnstreamer_tensors/tensors_test/meson.build @@ -0,0 +1,25 @@ +testtensors_sources = [ + 'gsttesttensors.c' +] + +testtensors = shared_library('testtensors', + testtensors_sources, + dependencies: [ + dependencies + ], + include_directories: inc, + objects: tensor_commonOBJ +) + +tensorscheck_sources = [ + 'gsttensorscheck.c' +] + +tensorscheckOBJ = shared_library('tensorscheck', + tensorscheck_sources, + dependencies: [ + dependencies + ], + include_directories: inc, + objects: tensor_commonOBJ +)