From: MyungJoo Ham Date: Thu, 8 Nov 2018 12:36:17 +0000 (+0900) Subject: Clean up customfilter dependencies, support non-single-binary mode X-Git-Tag: v0.0.3~109 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cf2668bb777673ff6e8e0d8ff11b38efb7c71719;p=platform%2Fupstream%2Fnnstreamer.git Clean up customfilter dependencies, support non-single-binary mode Building custom filter requires "libtensor_filter.so" only. Other libraries used by nnstreamer are not necessary for custom filters. Thus, let them depend on libtensor_filter (or libnnstreamer.so) only. Plus, by defining "CUSTOMFILTERDEP" CMake variable, support both SINGLEBINARY and NON-SINGLEBINARY. Signed-off-by: MyungJoo Ham --- diff --git a/CMakeLists.txt b/CMakeLists.txt index c852f20..1398e80 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,8 +13,10 @@ OPTION(ENABLE_TEST "Enable tests" ON) IF(SINGLE_BINARY) ADD_DEFINITIONS(-DSINGLE_BINARY) MESSAGE(STATUS "The nnstreamer elements will be created as a single plugin binary.") + SET(CUSTOMFILTERDEP nnstreamer) ELSE(SINGLE_BINARY) MESSAGE(STATUS "The nnstreamer elements will be created as multple plugin binaries, one binary for one element. This is no more the standard method to release since nnstreamer 0.0.3.") + SET(CUSTOMFILTERDEP tensor_filter) ENDIF(SINGLE_BINARY) SET(VERSION "0.0.3") diff --git a/nnstreamer_example/custom_example_LSTM/CMakeLists.txt b/nnstreamer_example/custom_example_LSTM/CMakeLists.txt index 8f804da..fb491a4 100644 --- a/nnstreamer_example/custom_example_LSTM/CMakeLists.txt +++ b/nnstreamer_example/custom_example_LSTM/CMakeLists.txt @@ -1,6 +1,6 @@ ADD_LIBRARY(dummyLSTM SHARED dummy_LSTM.c) -TARGET_LINK_LIBRARIES(dummyLSTM nnstreamer) +TARGET_LINK_LIBRARIES(dummyLSTM ${CUSTOMFILTERDEP}) INSTALL(TARGETS dummyLSTM RUNTIME DESTINATION ${EXEC_PREFIX} diff --git a/nnstreamer_example/custom_example_average/CMakeLists.txt b/nnstreamer_example/custom_example_average/CMakeLists.txt index ec55a29..fc7cf50 100644 --- a/nnstreamer_example/custom_example_average/CMakeLists.txt +++ b/nnstreamer_example/custom_example_average/CMakeLists.txt @@ -1,8 +1,6 @@ ADD_LIBRARY(nnstreamer_customfilter_average SHARED nnstreamer_customfilter_example_average.c) -TARGET_LINK_LIBRARIES(nnstreamer_customfilter_average ${pkgs_LIBRARIES}) -TARGET_INCLUDE_DIRECTORIES(nnstreamer_customfilter_average PUBLIC ${pkgs_INCLUDE_DIRS}) -TARGET_COMPILE_OPTIONS(nnstreamer_customfilter_average PUBLIC ${pkgs_CFLAGS_OTHER}) +TARGET_LINK_LIBRARIES(nnstreamer_customfilter_average ${CUSTOMFILTERDEP}) INSTALL(TARGETS nnstreamer_customfilter_average RUNTIME DESTINATION ${EXEC_PREFIX} diff --git a/nnstreamer_example/custom_example_opencv/CMakeLists.txt b/nnstreamer_example/custom_example_opencv/CMakeLists.txt index deeb269..6f97c8d 100644 --- a/nnstreamer_example/custom_example_opencv/CMakeLists.txt +++ b/nnstreamer_example/custom_example_opencv/CMakeLists.txt @@ -1,14 +1,12 @@ pkg_check_modules(opencv_pkg REQUIRED opencv) ADD_LIBRARY(nnstreamer_customfilter_opencv_scaler SHARED nnstreamer_customfilter_opencv_scaler.cc) -TARGET_LINK_LIBRARIES(nnstreamer_customfilter_opencv_scaler ${pkgs_LIBRARIES} ${opencv_pkg_LIBRARIES}) -TARGET_INCLUDE_DIRECTORIES(nnstreamer_customfilter_opencv_scaler PUBLIC ${pkgs_INCLUDE_DIRS} ${opencv_pkg_INCLUDE_DIRS}) -TARGET_COMPILE_OPTIONS(nnstreamer_customfilter_opencv_scaler PUBLIC ${pkgs_CFLAGS_OTHER}) +TARGET_LINK_LIBRARIES(nnstreamer_customfilter_opencv_scaler ${opencv_pkg_LIBRARIES} ${CUSTOMFILTERDEP}) +TARGET_INCLUDE_DIRECTORIES(nnstreamer_customfilter_opencv_scaler PUBLIC ${opencv_pkg_INCLUDE_DIRS}) ADD_LIBRARY(nnstreamer_customfilter_opencv_average SHARED nnstreamer_customfilter_opencv_average.cc) -TARGET_LINK_LIBRARIES(nnstreamer_customfilter_opencv_average ${pkgs_LIBRARIES} ${opencv_pkg_LIBRARIES}) -TARGET_INCLUDE_DIRECTORIES(nnstreamer_customfilter_opencv_average PUBLIC ${pkgs_INCLUDE_DIRS} ${opencv_pkg_INCLUDE_DIRS}) -TARGET_COMPILE_OPTIONS(nnstreamer_customfilter_opencv_average PUBLIC ${pkgs_CFLAGS_OTHER}) +TARGET_LINK_LIBRARIES(nnstreamer_customfilter_opencv_average ${opencv_pkg_LIBRARIES} ${CUSTOMFILTERDEP}) +TARGET_INCLUDE_DIRECTORIES(nnstreamer_customfilter_opencv_average PUBLIC ${opencv_pkg_INCLUDE_DIRS}) INSTALL(TARGETS nnstreamer_customfilter_opencv_scaler RUNTIME DESTINATION ${EXEC_PREFIX} diff --git a/nnstreamer_example/custom_example_passthrough/CMakeLists.txt b/nnstreamer_example/custom_example_passthrough/CMakeLists.txt index 279cf6f..d5cade0 100644 --- a/nnstreamer_example/custom_example_passthrough/CMakeLists.txt +++ b/nnstreamer_example/custom_example_passthrough/CMakeLists.txt @@ -1,13 +1,8 @@ ADD_LIBRARY(nnstreamer_customfilter_passthrough SHARED nnstreamer_customfilter_example_passthrough.c) ADD_LIBRARY(nnstreamer_customfilter_passthrough_variable SHARED nnstreamer_customfilter_example_passthrough_variable.c) -TARGET_LINK_LIBRARIES(nnstreamer_customfilter_passthrough ${pkgs_LIBRARIES}) -TARGET_INCLUDE_DIRECTORIES(nnstreamer_customfilter_passthrough PUBLIC ${pkgs_INCLUDE_DIRS}) -TARGET_COMPILE_OPTIONS(nnstreamer_customfilter_passthrough PUBLIC ${pkgs_CFLAGS_OTHER}) - -TARGET_LINK_LIBRARIES(nnstreamer_customfilter_passthrough_variable ${pkgs_LIBRARIES}) -TARGET_INCLUDE_DIRECTORIES(nnstreamer_customfilter_passthrough_variable PUBLIC ${pkgs_INCLUDE_DIRS}) -TARGET_COMPILE_OPTIONS(nnstreamer_customfilter_passthrough_variable PUBLIC ${pkgs_CFLAGS_OTHER}) +TARGET_LINK_LIBRARIES(nnstreamer_customfilter_passthrough ${CUSTOMFILTERDEP}) +TARGET_LINK_LIBRARIES(nnstreamer_customfilter_passthrough_variable ${CUSTOMFILTERDEP}) INSTALL(TARGETS nnstreamer_customfilter_passthrough nnstreamer_customfilter_passthrough_variable RUNTIME DESTINATION ${EXEC_PREFIX} diff --git a/nnstreamer_example/custom_example_scaler/CMakeLists.txt b/nnstreamer_example/custom_example_scaler/CMakeLists.txt index 1361b8f..f8b3bfa 100644 --- a/nnstreamer_example/custom_example_scaler/CMakeLists.txt +++ b/nnstreamer_example/custom_example_scaler/CMakeLists.txt @@ -1,12 +1,10 @@ ADD_LIBRARY(nnstreamer_customfilter_scaler SHARED nnstreamer_customfilter_example_scaler.c) -TARGET_LINK_LIBRARIES(nnstreamer_customfilter_scaler ${pkgs_LIBRARIES}) -TARGET_COMPILE_OPTIONS(nnstreamer_customfilter_scaler PUBLIC ${pkgs_CFLAGS_OTHER}) +TARGET_LINK_LIBRARIES(nnstreamer_customfilter_scaler ${CUSTOMFILTERDEP}) ADD_LIBRARY(nnstreamer_customfilter_scaler_allocator SHARED nnstreamer_customfilter_example_scaler_allocator.c) -TARGET_LINK_LIBRARIES(nnstreamer_customfilter_scaler_allocator ${pkgs_LIBRARIES}) -TARGET_COMPILE_OPTIONS(nnstreamer_customfilter_scaler_allocator PUBLIC ${pkgs_CFLAGS_OTHER}) +TARGET_LINK_LIBRARIES(nnstreamer_customfilter_scaler_allocator ${CUSTOMFILTERDEP}) INSTALL(TARGETS nnstreamer_customfilter_scaler nnstreamer_customfilter_scaler_allocator RUNTIME DESTINATION ${EXEC_PREFIX} diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index ed61095..a6fbd3a 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -38,7 +38,8 @@ TARGET_LINK_LIBRARIES(unittest_sink ${pkgs_LIBRARIES} ${testpkgs_LIBRARIES} ${gt # Unit test uses this custom filter ADD_LIBRARY(nnscustom_framecounter SHARED nnstreamer_sink/nnscustom_framecounter.c) -TARGET_LINK_LIBRARIES(nnscustom_framecounter nnstreamer) +TARGET_LINK_LIBRARIES(nnscustom_framecounter ${CUSTOMFILTERDEP}) + ADD_TEST(NAME unit_test COMMAND sh -c "GST_PLUGIN_PATH=${PROJECT_SOURCE_DIR}/build ssat ${CMAKE_CURRENT_SOURCE_DIR}")