OPTION(ENABLE_TENSORFLOW "Enable tensorflow support" OFF)
OPTION(ENABLE_MODEL_DOWNLOAD "Enable download the model files" ON)
OPTION(INSTALL_EXAMPLE_APP "Install example applications" OFF)
-OPTION(SINGLE_BINARY "Generate a single binary for all nnstreamer elements" ON)
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")
ADD_DEFINITIONS(-DVERSION="${VERSION}")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Wall -Werror -fPIC -g -std=c89")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CXXFLAGS} -Wall -Werror -fPIC -g -std=c++11")
-# Provide common data
-ADD_LIBRARY(common STATIC gst/nnstreamer/tensor_common.c)
-TARGET_LINK_LIBRARIES(common ${pkgs_LIBRARIES})
-TARGET_INCLUDE_DIRECTORIES(common PUBLIC ${pkgs_INCLUDE_DIRS})
-SET(pkgs_LIBRARIES ${pkgs_LIBRARIES} common)
-
# Supported projects for the single binary
SET(PROJECTS
tensor_aggregator
ENDIF(ENABLE_TENSORFLOW)
LIST(LENGTH FILTER_DEP FILTER_DEP_LEN)
-IF (SINGLE_BINARY)
- ADD_LIBRARY(nnstreamerStatic STATIC gst/nnstreamer/nnstreamer.c ${OBJECTS} gst/nnstreamer/tensor_common.c)
- SET_TARGET_PROPERTIES(nnstreamerStatic PROPERTIES OUTPUT_NAME nnstreamer)
- TARGET_INCLUDE_DIRECTORIES(nnstreamerStatic PUBLIC ${pkgs_INCLUDE_DIRS})
- TARGET_COMPILE_OPTIONS(nnstreamerStatic PUBLIC ${pkgs_CFLAGS_OTHER})
-
- ADD_LIBRARY(nnstreamer SHARED gst/nnstreamer/nnstreamer.c ${OBJECTS})
- TARGET_INCLUDE_DIRECTORIES(nnstreamer PUBLIC ${pkgs_INCLUDE_DIRS})
- TARGET_COMPILE_OPTIONS(nnstreamer PUBLIC ${pkgs_CFLAGS_OTHER})
- TARGET_LINK_LIBRARIES(nnstreamer ${pkgs_LIBRARIES} ${FILTER_LIB})
-
- IF (FILTER_DEP_LEN GREATER 0)
- ADD_DEPENDENCIES(nnstreamer ${FILTER_DEP})
- ADD_DEPENDENCIES(nnstreamerStatic ${FILTER_DEP})
- ENDIF (FILTER_DEP_LEN GREATER 0)
-
- INSTALL(TARGETS nnstreamerStatic nnstreamer
- RUNTIME DESTINATION ${EXEC_PREFIX}
- LIBRARY DESTINATION ${GST_INSTALL_DIR}
- ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
- )
-ELSE (SINGLE_BINARY)
- FOREACH(PRJ IN LISTS PROJECTS)
- ADD_LIBRARY(${PRJ}Static STATIC $<TARGET_OBJECTS:${PRJ}OBJ>)
- SET_TARGET_PROPERTIES(${PRJ}Static PROPERTIES OUTPUT_NAME ${PRJ})
- TARGET_INCLUDE_DIRECTORIES(${PRJ}Static PUBLIC ${pkgs_INCLUDE_DIRS})
- TARGET_COMPILE_OPTIONS(${PRJ}Static PUBLIC ${pkgs_CFLAGS_OTHER})
-
- ADD_LIBRARY(${PRJ} SHARED $<TARGET_OBJECTS:${PRJ}OBJ>)
- TARGET_INCLUDE_DIRECTORIES(${PRJ} PUBLIC ${pkgs_INCLUDE_DIRS} ${NNSTREAMER_ADDITIONAL_INCDIR})
- TARGET_COMPILE_OPTIONS(${PRJ} PUBLIC ${pkgs_CFLAGS_OTHER} ${NNSTREAMER_ADDITIONAL_FLAGS})
- IF(PRJ STREQUAL "tensor_filter")
- TARGET_LINK_LIBRARIES(${PRJ} ${pkgs_LIBRARIES} ${FILTER_LIB})
- IF (FILTER_DEP_LEN GREATER 0)
- ADD_DEPENDENCIES(${PRJ} ${FILTER_DEP})
- ENDIF (FILTER_DEP_LEN GREATER 0)
- ELSE(PRJ STREQUAL "tensor_filter")
- TARGET_LINK_LIBRARIES(${PRJ} ${pkgs_LIBRARIES})
- ENDIF(PRJ STREQUAL "tensor_filter")
-
- INSTALL(TARGETS ${PRJ}Static ${PRJ}
- RUNTIME DESTINATION ${EXEC_PREFIX}
- LIBRARY DESTINATION ${GST_INSTALL_DIR}
- ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
- )
- ENDFOREACH(PRJ)
-ENDIF (SINGLE_BINARY)
+ADD_LIBRARY(nnstreamerStatic STATIC gst/nnstreamer/nnstreamer.c gst/nnstreamer/tensor_common.c ${OBJECTS})
+SET_TARGET_PROPERTIES(nnstreamerStatic PROPERTIES OUTPUT_NAME nnstreamer)
+TARGET_INCLUDE_DIRECTORIES(nnstreamerStatic PUBLIC ${pkgs_INCLUDE_DIRS})
+TARGET_COMPILE_OPTIONS(nnstreamerStatic PUBLIC ${pkgs_CFLAGS_OTHER})
+
+ADD_LIBRARY(nnstreamer SHARED gst/nnstreamer/nnstreamer.c gst/nnstreamer/tensor_common.c ${OBJECTS})
+TARGET_INCLUDE_DIRECTORIES(nnstreamer PUBLIC ${pkgs_INCLUDE_DIRS})
+TARGET_COMPILE_OPTIONS(nnstreamer PUBLIC ${pkgs_CFLAGS_OTHER})
+TARGET_LINK_LIBRARIES(nnstreamer ${pkgs_LIBRARIES} ${FILTER_LIB})
+
+IF (FILTER_DEP_LEN GREATER 0)
+ ADD_DEPENDENCIES(nnstreamer ${FILTER_DEP})
+ ADD_DEPENDENCIES(nnstreamerStatic ${FILTER_DEP})
+ENDIF (FILTER_DEP_LEN GREATER 0)
+
+INSTALL(TARGETS nnstreamerStatic nnstreamer
+ RUNTIME DESTINATION ${EXEC_PREFIX}
+ LIBRARY DESTINATION ${GST_INSTALL_DIR}
+ ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
+)
CONFIGURE_FILE(nnstreamer.pc.in nnstreamer.pc @ONLY)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/nnstreamer.pc
DESTINATION ${LIB_INSTALL_DIR}/pkgconfig
)
-
-# Custom plugins need to use common archive (static lib)
-INSTALL(TARGETS common
- RUNTIME DESTINATION ${EXEC_PREFIX}
- LIBRARY DESTINATION ${GST_INSTALL_DIR}
- ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
- )
/usr/include/nnstreamer/*.h
/usr/lib/pkgconfig/*.pc
/usr/lib/libnnstreamer.a
-/usr/lib/libcommon.a
/usr/lib/libtensor_filter*.a
return TRUE;
}
-#ifndef SINGLE_BINARY
-#error SINGLE_BINARY must be defined
-#endif
-
#ifndef PACKAGE
#define PACKAGE "nnstreamer"
#endif
gst_caps_new_simple ("other/tensorsave", NULL, NULL), NULL, NULL)); \
} while (0)
-#ifdef SINGLE_BINARY
#define NNSTREAMER_PLUGIN_INIT(name) \
gboolean G_PASTE(nnstreamer_export_, name) (GstPlugin * plugin)
-#else
-#define NNSTREAMER_PLUGIN_INIT(name) \
- static gboolean G_PASTE(G_PASTE(gst_, name), _plugin_init) (GstPlugin * plugin)
-#endif
/**
return gst_element_register (plugin, "tensor_aggregator",
GST_RANK_NONE, GST_TYPE_TENSOR_AGGREGATOR);
}
-
-#ifndef SINGLE_BINARY
-/**
- * @brief Definition for identifying tensor_aggregator plugin.
- *
- * PACKAGE: this is usually set by autotools depending on some _INIT macro
- * in configure.ac and then written into and defined in config.h, but we can
- * just set it ourselves here in case someone doesn't use autotools to
- * compile this code. GST_PLUGIN_DEFINE needs PACKAGE to be defined.
- */
-#ifndef PACKAGE
-#define PACKAGE "nnstreamer"
-#endif
-
-/**
- * @brief Macro to define the entry point of the plugin.
- */
-GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
- GST_VERSION_MINOR,
- tensor_aggregator,
- "GStreamer plugin to aggregate tensor stream",
- gst_tensor_aggregator_plugin_init, VERSION, "LGPL", "nnstreamer",
- "http://github.com/nnsuite/nnstreamer/");
-#endif
return gst_element_register (plugin, "tensor_converter",
GST_RANK_NONE, GST_TYPE_TENSOR_CONVERTER);
}
-
-#ifndef SINGLE_BINARY
-/**
- * @brief Definition for identifying tensor_converter plugin.
- *
- * PACKAGE: this is usually set by autotools depending on some _INIT macro
- * in configure.ac and then written into and defined in config.h, but we can
- * just set it ourselves here in case someone doesn't use autotools to
- * compile this code. GST_PLUGIN_DEFINE needs PACKAGE to be defined.
- */
-#ifndef PACKAGE
-#define PACKAGE "nnstreamer"
-#endif
-
-/**
- * @brief Macro to define the entry point of the plugin.
- */
-GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
- GST_VERSION_MINOR,
- tensor_converter,
- "GStreamer plugin to convert media types to tensors",
- gst_tensor_converter_plugin_init, VERSION, "LGPL", "nnstreamer",
- "https://github.com/nnsuite/nnstreamer/");
-#endif
return gst_element_register (plugin, "tensor_decoder", GST_RANK_NONE,
GST_TYPE_TENSORDEC);
}
-
-#ifndef SINGLE_BINARY
-/**
- * PACKAGE: this is usually set by autotools depending on some _INIT macro
- * in configure.ac and then written into and defined in config.h, but we can
- * just set it ourselves here in case someone doesn't use autotools to
- * compile this code. GST_PLUGIN_DEFINE needs PACKAGE to be defined.
- */
-#ifndef PACKAGE
-#define PACKAGE "nnstreamer"
-#endif
-
-/**
- * gstreamer looks for this structure to register tensor_decoder
- */
-GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
- GST_VERSION_MINOR,
- tensor_decoder,
- "Element to convert tensor to media stream",
- gst_tensor_decoder_plugin_init,
- VERSION, "LGPL", "nnstreamer", "http://github.com/nnsuite/nnstreamer/");
-#endif
return gst_element_register (plugin, "tensor_demux",
GST_RANK_NONE, GST_TYPE_TENSOR_DEMUX);
}
-
-#ifndef SINGLE_BINARY
-/**
- * PACKAGE: this is usually set by autotools depending on some _INIT macro
- * in configure.ac and then written into and defined in config.h, but we can
- * just set it ourselves here in case someone doesn't use autotools to
- * compile this code. GST_PLUGIN_DEFINE needs PACKAGE to be defined.
- */
-#ifndef PACKAGE
-#define PACKAGE "nnstreamer"
-#endif
-
-/**
- * @brief gstreamer looks for this structure to register tensor_demux
- */
-GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
- GST_VERSION_MINOR,
- tensor_demux,
- "tensor_demux",
- gst_tensor_demux_plugin_init, VERSION, "LGPL", "nnstreamer",
- "http://github.com/nnsuite/nnstreamer/");
-#endif
return gst_element_register (plugin, "tensor_filter", GST_RANK_NONE,
GST_TYPE_TENSOR_FILTER);
}
-
-#ifndef SINGLE_BINARY
-/**
- * @brief Definition for identifying tensor_filter plugin.
- *
- * PACKAGE: this is usually set by autotools depending on some _INIT macro
- * in configure.ac and then written into and defined in config.h, but we can
- * just set it ourselves here in case someone doesn't use autotools to
- * compile this code. GST_PLUGIN_DEFINE needs PACKAGE to be defined.
- */
-#ifndef PACKAGE
-#define PACKAGE "nnstreamer"
-#endif
-
-/**
- * @brief Macro to define the entry point of the plugin.
- * gstreamer looks for this structure to register tensor_filter.
- */
-GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
- GST_VERSION_MINOR,
- tensor_filter,
- "GStreamer plugin to use general neural network frameworks as filters",
- gst_tensor_filter_plugin_init, VERSION, "LGPL", "nnstreamer",
- "https://github.com/nnsuite/nnstreamer/");
-#endif
return gst_element_register (plugin, "tensor_merge",
GST_RANK_NONE, GST_TYPE_TENSOR_MERGE);
}
-
-#ifndef SINGLE_BINARY
-/**
- * PACKAGE: this is usually set by autotools depending on some _INIT macro
- * in configure.ac and then written into and defined in config.h, but we can
- * just set it ourselves here in case someone doesn't use autotools to
- * compile this code. GST_PLUGIN_DEFINE needs PACKAGE to be defined.
- */
-#ifndef PACKAGE
-#define PACKAGE "nnstreamer"
-#endif
-
-/**
- * @brief gstreamer looks for this structure to register tensormerge
- */
-GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
- GST_VERSION_MINOR,
- tensor_merge,
- "tensor merge plugin",
- gst_tensor_merge_plugin_init, VERSION, "LGPL", "nnstreamer",
- "https://github.com/nnsuite/nnstreamer/");
-#endif
return gst_element_register (plugin, "tensor_mux",
GST_RANK_NONE, GST_TYPE_TENSOR_MUX);
}
-
-#ifndef SINGLE_BINARY
-/**
- * PACKAGE: this is usually set by autotools depending on some _INIT macro
- * in configure.ac and then written into and defined in config.h, but we can
- * just set it ourselves here in case someone doesn't use autotools to
- * compile this code. GST_PLUGIN_DEFINE needs PACKAGE to be defined.
- */
-#ifndef PACKAGE
-#define PACKAGE "nnstreamer"
-#endif
-
-/**
- * @brief gstreamer looks for this structure to register tensormux
- */
-GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
- GST_VERSION_MINOR,
- tensor_mux,
- "tensor mux plugin",
- gst_tensor_mux_plugin_init, VERSION, "LGPL", "nnstreamer",
- "https://github.com/nnsuite/nnstreamer/");
-#endif
return gst_element_register (plugin, "tensor_load",
GST_RANK_NONE, GST_TYPE_TENSOR_LOAD);
}
-
-#ifndef SINGLE_BINARY
-/**
- * PACKAGE: this is usually set by autotools depending on some _INIT macro
- * in configure.ac and then written into and defined in config.h, but we can
- * just set it ourselves here in case someone doesn't use autotools to
- * compile this code. GST_PLUGIN_DEFINE needs PACKAGE to be defined.
- */
-#ifndef PACKAGE
-#define PACKAGE "nnstreamer"
-#endif
-
-/**
- * gstreamer looks for this structure to register tensor_loads
- *
- * exchange the string 'Template tensor_load' with your tensor_load description
- */
-GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
- GST_VERSION_MINOR,
- tensor_load,
- "Load other/tensor_save and as other/tensor or other/tensors",
- gst_tensor_load_plugin_init, VERSION, "LGPL", "nnstreamer",
- "https://github.com/nnsuite/nnstreamer/");
-#endif
return gst_element_register (plugin, "tensor_sink",
GST_RANK_NONE, GST_TYPE_TENSOR_SINK);
}
-
-#ifndef SINGLE_BINARY
-/**
- * @brief Definition for identifying tensor_sink plugin.
- *
- * PACKAGE: this is usually set by autotools depending on some _INIT macro
- * in configure.ac and then written into and defined in config.h, but we can
- * just set it ourselves here in case someone doesn't use autotools to
- * compile this code. GST_PLUGIN_DEFINE needs PACKAGE to be defined.
- */
-#ifndef PACKAGE
-#define PACKAGE "nnstreamer"
-#endif
-
-/**
- * @brief Macro to define the entry point of the plugin.
- */
-GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
- GST_VERSION_MINOR,
- tensor_sink,
- "Sink element to handle tensor stream",
- gst_tensor_sink_plugin_init, VERSION, "LGPL", "nnstreamer",
- "https://github.com/nnsuite/nnstreamer");
-#endif
return gst_element_register (plugin, "tensor_split",
GST_RANK_NONE, GST_TYPE_TENSOR_SPLIT);
}
-
-#ifndef SINGLE_BINARY
-/**
- * PACKAGE: this is usually set by autotools depending on some _INIT macro
- * in configure.ac and then written into and defined in config.h, but we can
- * just set it ourselves here in case someone doesn't use autotools to
- * compile this code. GST_PLUGIN_DEFINE needs PACKAGE to be defined.
- */
-#ifndef PACKAGE
-#define PACKAGE "nnstreamer"
-#endif
-
-/**
- * @brief gstreamer looks for this structure to register tensorsplit
- */
-GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
- GST_VERSION_MINOR,
- tensor_split,
- "tensor split plugin",
- gst_tensor_split_plugin_init, VERSION, "LGPL", "nnstreamer",
- "https://github.com/nnsuite/nnstreamer/");
-#endif
return gst_element_register (plugin, "tensor_transform",
GST_RANK_NONE, GST_TYPE_TENSOR_TRANSFORM);
}
-
-#ifndef SINGLE_BINARY
-/**
- * PACKAGE: this is usually set by autotools depending on some _INIT macro
- * in configure.ac and then written into and defined in config.h, but we can
- * just set it ourselves here in case someone doesn't use autotools to
- * compile this code. GST_PLUGIN_DEFINE needs PACKAGE to be defined.
- */
-#ifndef PACKAGE
-#define PACKAGE "nnstreamer"
-#endif
-
-/**
- * gstreamer looks for this structure to register tensor_transforms
- */
-GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
- GST_VERSION_MINOR,
- tensor_transform,
- "GStreamer plugin to transform tensor dimension or type",
- gst_tensor_transform_plugin_init, VERSION, "LGPL", "nnstreamer",
- "https://github.com/nnsuite/nnstreamer");
-#endif
ADD_LIBRARY(dummyLSTM SHARED dummy_LSTM.c)
-TARGET_LINK_LIBRARIES(dummyLSTM ${CUSTOMFILTERDEP})
+TARGET_LINK_LIBRARIES(dummyLSTM nnstreamer)
INSTALL(TARGETS dummyLSTM
RUNTIME DESTINATION ${EXEC_PREFIX}
ADD_LIBRARY(nnstreamer_customfilter_average SHARED nnstreamer_customfilter_example_average.c)
-TARGET_LINK_LIBRARIES(nnstreamer_customfilter_average ${CUSTOMFILTERDEP})
+TARGET_LINK_LIBRARIES(nnstreamer_customfilter_average nnstreamer)
INSTALL(TARGETS nnstreamer_customfilter_average
RUNTIME DESTINATION ${EXEC_PREFIX}
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 ${opencv_pkg_LIBRARIES} ${CUSTOMFILTERDEP})
+TARGET_LINK_LIBRARIES(nnstreamer_customfilter_opencv_scaler ${opencv_pkg_LIBRARIES} nnstreamer)
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 ${opencv_pkg_LIBRARIES} ${CUSTOMFILTERDEP})
+TARGET_LINK_LIBRARIES(nnstreamer_customfilter_opencv_average ${opencv_pkg_LIBRARIES} nnstreamer)
TARGET_INCLUDE_DIRECTORIES(nnstreamer_customfilter_opencv_average PUBLIC ${opencv_pkg_INCLUDE_DIRS})
INSTALL(TARGETS nnstreamer_customfilter_opencv_scaler
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 ${CUSTOMFILTERDEP})
-TARGET_LINK_LIBRARIES(nnstreamer_customfilter_passthrough_variable ${CUSTOMFILTERDEP})
+TARGET_LINK_LIBRARIES(nnstreamer_customfilter_passthrough nnstreamer)
+TARGET_LINK_LIBRARIES(nnstreamer_customfilter_passthrough_variable nnstreamer)
INSTALL(TARGETS nnstreamer_customfilter_passthrough nnstreamer_customfilter_passthrough_variable
RUNTIME DESTINATION ${EXEC_PREFIX}
ADD_LIBRARY(nnstreamer_customfilter_scaler SHARED nnstreamer_customfilter_example_scaler.c)
-TARGET_LINK_LIBRARIES(nnstreamer_customfilter_scaler ${CUSTOMFILTERDEP})
+TARGET_LINK_LIBRARIES(nnstreamer_customfilter_scaler nnstreamer)
ADD_LIBRARY(nnstreamer_customfilter_scaler_allocator SHARED nnstreamer_customfilter_example_scaler_allocator.c)
-TARGET_LINK_LIBRARIES(nnstreamer_customfilter_scaler_allocator ${CUSTOMFILTERDEP})
+TARGET_LINK_LIBRARIES(nnstreamer_customfilter_scaler_allocator nnstreamer)
INSTALL(TARGETS nnstreamer_customfilter_scaler nnstreamer_customfilter_scaler_allocator
RUNTIME DESTINATION ${EXEC_PREFIX}
cp -r result %{buildroot}%{_datadir}/nnstreamer/unittest/
%endif
-install build/libcommon.a %{buildroot}%{_libdir}/
install build/libnnstreamer.a %{buildroot}%{_libdir}/
install build/gst/tensor_filter/*.a %{buildroot}%{_libdir}/
# Unit test for common
ADD_EXECUTABLE(unittest_common common/unittest_common.cpp ${gtestSrc})
TARGET_INCLUDE_DIRECTORIES(unittest_common PUBLIC ${pkgs_INCLUDE_DIRS} ${testpkgs_INCLUDE_DIRS} ${gtestInc})
-TARGET_LINK_LIBRARIES(unittest_common ${pkgs_LIBRARIES} ${testpkgs_LIBRARIES} ${gtestLink})
+TARGET_LINK_LIBRARIES(unittest_common nnstreamer ${pkgs_LIBRARIES} ${testpkgs_LIBRARIES} ${gtestLink})
# Unit test using tensor_sink
ADD_EXECUTABLE(unittest_sink nnstreamer_sink/unittest_sink.cpp ${gtestSrc})
TARGET_INCLUDE_DIRECTORIES(unittest_sink PUBLIC ${pkgs_INCLUDE_DIRS} ${testpkgs_INCLUDE_DIRS} ${gtestInc})
-TARGET_LINK_LIBRARIES(unittest_sink ${pkgs_LIBRARIES} ${testpkgs_LIBRARIES} ${gtestLink})
+TARGET_LINK_LIBRARIES(unittest_sink nnstreamer ${pkgs_LIBRARIES} ${testpkgs_LIBRARIES} ${gtestLink})
# Unit test uses this custom filter
ADD_LIBRARY(nnscustom_framecounter SHARED nnstreamer_sink/nnscustom_framecounter.c)
-TARGET_LINK_LIBRARIES(nnscustom_framecounter ${CUSTOMFILTERDEP} glib-2.0)
+TARGET_LINK_LIBRARIES(nnscustom_framecounter nnstreamer glib-2.0)
# Unit test for nnstreamer plugins
ADD_EXECUTABLE(unittest_plugins nnstreamer_plugins/unittest_plugins.cpp ${gtestSrc})
TARGET_INCLUDE_DIRECTORIES(unittest_plugins PUBLIC ${pkgs_INCLUDE_DIRS} ${testpkgs_INCLUDE_DIRS} ${gtestInc})
-TARGET_LINK_LIBRARIES(unittest_plugins ${pkgs_LIBRARIES} ${testpkgs_LIBRARIES} ${gtestLink})
+TARGET_LINK_LIBRARIES(unittest_plugins nnstreamer ${pkgs_LIBRARIES} ${testpkgs_LIBRARIES} ${gtestLink})
ADD_TEST(NAME unit_test
COMMAND sh -c "GST_PLUGIN_PATH=${PROJECT_SOURCE_DIR}/build ssat ${CMAKE_CURRENT_SOURCE_DIR}")
ADD_LIBRARY(testtensors SHARED gsttesttensors.c )
ADD_LIBRARY(testtensorsStatic STATIC gsttesttensors.c)
-TARGET_LINK_LIBRARIES(testtensors ${pkgs_LIBRARIES})
+TARGET_LINK_LIBRARIES(testtensors ${pkgs_LIBRARIES} nnstreamer)
TARGET_INCLUDE_DIRECTORIES(testtensors PUBLIC ${pkgs_INCLUDE_DIRS})
TARGET_COMPILE_OPTIONS(testtensors PUBLIC ${pkgs_CFLAGS_OTHER})
-TARGET_LINK_LIBRARIES(testtensorsStatic ${pkgs_LIBRARIES})
+TARGET_LINK_LIBRARIES(testtensorsStatic ${pkgs_LIBRARIES} nnstreamer)
TARGET_INCLUDE_DIRECTORIES(testtensorsStatic PUBLIC ${pkgs_INCLUDE_DIRS})
TARGET_COMPILE_OPTIONS(testtensorsStatic PUBLIC ${pkgs_CFLAGS_OTHER})
ADD_LIBRARY(tensorscheck SHARED gsttensorscheck.c )
ADD_LIBRARY(tensorscheckStatic STATIC gsttensorscheck.c)
-TARGET_LINK_LIBRARIES(tensorscheck ${pkgs_LIBRARIES})
+TARGET_LINK_LIBRARIES(tensorscheck ${pkgs_LIBRARIES} nnstreamer)
TARGET_INCLUDE_DIRECTORIES(tensorscheck PUBLIC ${pkgs_INCLUDE_DIRS})
TARGET_COMPILE_OPTIONS(tensorscheck PUBLIC ${pkgs_CFLAGS_OTHER})
-TARGET_LINK_LIBRARIES(tensorscheckStatic ${pkgs_LIBRARIES})
+TARGET_LINK_LIBRARIES(tensorscheckStatic ${pkgs_LIBRARIES} nnstreamer)
TARGET_INCLUDE_DIRECTORIES(tensorscheckStatic PUBLIC ${pkgs_INCLUDE_DIRS})
TARGET_COMPILE_OPTIONS(tensorscheckStatic PUBLIC ${pkgs_CFLAGS_OTHER})