Examples don't need to link nnstreamer libs.
Remove this link and add modules for each examples.
Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
-# Example App build requires a few additional attention if tizen_app_build_example is not used.
-
-SET(PKGAPP_MODULES
- gstreamer-1.0
- gstreamer-base-1.0
- gstreamer-controller-1.0
- gstreamer-video-1.0
- gstreamer-audio-1.0
- gstreamer-app-1.0
-)
-pkg_check_modules(apppkgs REQUIRED ${PKGAPP_MODULES})
-
ADD_SUBDIRECTORY(custom_example_passthrough)
ADD_SUBDIRECTORY(custom_example_scaler)
ADD_SUBDIRECTORY(custom_example_average)
ADD_LIBRARY(dummyLSTM SHARED dummy_LSTM.c)
-TARGET_LINK_LIBRARIES(dummyLSTM nnstreamer)
+TARGET_LINK_LIBRARIES(dummyLSTM m)
INSTALL(TARGETS dummyLSTM
LIBRARY DESTINATION ${LIB_INSTALL_DIR}
ADD_LIBRARY(dummyRNN SHARED dummy_RNN.c)
-TARGET_LINK_LIBRARIES(dummyRNN nnstreamer)
-
INSTALL(TARGETS dummyRNN
LIBRARY DESTINATION ${LIB_INSTALL_DIR}
ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
ADD_LIBRARY(nnstreamer_customfilter_average SHARED nnstreamer_customfilter_example_average.c)
-TARGET_LINK_LIBRARIES(nnstreamer_customfilter_average nnstreamer)
-
INSTALL(TARGETS nnstreamer_customfilter_average
LIBRARY DESTINATION ${LIB_INSTALL_DIR}
ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
-pkg_check_modules(opencv_pkg REQUIRED opencv)
+pkg_check_modules(custfilter_ex_opencv_pkgs glib-2.0 opencv REQUIRED)
ADD_LIBRARY(nnstreamer_customfilter_opencv_scaler SHARED nnstreamer_customfilter_opencv_scaler.cc)
-TARGET_LINK_LIBRARIES(nnstreamer_customfilter_opencv_scaler ${opencv_pkg_LIBRARIES} nnstreamer)
-TARGET_INCLUDE_DIRECTORIES(nnstreamer_customfilter_opencv_scaler PUBLIC ${opencv_pkg_INCLUDE_DIRS})
+TARGET_LINK_LIBRARIES(nnstreamer_customfilter_opencv_scaler ${custfilter_ex_opencv_pkgs_LIBRARIES})
+TARGET_INCLUDE_DIRECTORIES(nnstreamer_customfilter_opencv_scaler PUBLIC ${custfilter_ex_opencv_pkgs_INCLUDE_DIRS})
ADD_LIBRARY(nnstreamer_customfilter_opencv_average SHARED nnstreamer_customfilter_opencv_average.cc)
-TARGET_LINK_LIBRARIES(nnstreamer_customfilter_opencv_average ${opencv_pkg_LIBRARIES} nnstreamer)
-TARGET_INCLUDE_DIRECTORIES(nnstreamer_customfilter_opencv_average PUBLIC ${opencv_pkg_INCLUDE_DIRS})
+TARGET_LINK_LIBRARIES(nnstreamer_customfilter_opencv_average ${custfilter_ex_opencv_pkgs_LIBRARIES})
+TARGET_INCLUDE_DIRECTORIES(nnstreamer_customfilter_opencv_average PUBLIC ${custfilter_ex_opencv_pkgs_INCLUDE_DIRS})
-INSTALL(TARGETS nnstreamer_customfilter_opencv_scaler
- LIBRARY DESTINATION ${LIB_INSTALL_DIR}
- ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
-)
-
-INSTALL(TARGETS nnstreamer_customfilter_opencv_average
+INSTALL(TARGETS nnstreamer_customfilter_opencv_scaler nnstreamer_customfilter_opencv_average
LIBRARY DESTINATION ${LIB_INSTALL_DIR}
ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
)
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 nnstreamer)
-TARGET_LINK_LIBRARIES(nnstreamer_customfilter_passthrough_variable nnstreamer)
-
INSTALL(TARGETS nnstreamer_customfilter_passthrough nnstreamer_customfilter_passthrough_variable
LIBRARY DESTINATION ${LIB_INSTALL_DIR}
ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
-ADD_LIBRARY(nnstreamer_customfilter_scaler SHARED nnstreamer_customfilter_example_scaler.c)
+pkg_check_modules(custfilter_ex_scaler_pkgs glib-2.0 REQUIRED)
-TARGET_LINK_LIBRARIES(nnstreamer_customfilter_scaler nnstreamer)
+ADD_LIBRARY(nnstreamer_customfilter_scaler SHARED nnstreamer_customfilter_example_scaler.c)
+TARGET_LINK_LIBRARIES(nnstreamer_customfilter_scaler ${custfilter_ex_scaler_pkgs_LIBRARIES})
+TARGET_INCLUDE_DIRECTORIES(nnstreamer_customfilter_scaler PUBLIC ${custfilter_ex_scaler_pkgs_INCLUDE_DIRS})
ADD_LIBRARY(nnstreamer_customfilter_scaler_allocator SHARED nnstreamer_customfilter_example_scaler_allocator.c)
-
-TARGET_LINK_LIBRARIES(nnstreamer_customfilter_scaler_allocator nnstreamer)
+TARGET_LINK_LIBRARIES(nnstreamer_customfilter_scaler_allocator ${custfilter_ex_scaler_pkgs_LIBRARIES})
+TARGET_INCLUDE_DIRECTORIES(nnstreamer_customfilter_scaler PUBLIC ${custfilter_ex_scaler_pkgs_INCLUDE_DIRS})
INSTALL(TARGETS nnstreamer_customfilter_scaler nnstreamer_customfilter_scaler_allocator
LIBRARY DESTINATION ${LIB_INSTALL_DIR}
-# example app for webcam
+pkg_check_modules(app_ex_cam_pkgs gstreamer-1.0 glib-2.0 REQUIRED)
+
ADD_EXECUTABLE(nnstreamer_example_cam nnstreamer_example_cam.c)
-TARGET_LINK_LIBRARIES(nnstreamer_example_cam ${apppkgs_LIBRARIES})
-TARGET_INCLUDE_DIRECTORIES(nnstreamer_example_cam PUBLIC ${apppkgs_INCLUDE_DIRS})
-TARGET_COMPILE_OPTIONS(nnstreamer_example_cam PUBLIC ${apppkgs_CFLAGS_OTHER})
+TARGET_LINK_LIBRARIES(nnstreamer_example_cam ${app_ex_cam_pkgs_LIBRARIES})
+TARGET_INCLUDE_DIRECTORIES(nnstreamer_example_cam PUBLIC ${app_ex_cam_pkgs_INCLUDE_DIRS})
+TARGET_COMPILE_OPTIONS(nnstreamer_example_cam PUBLIC ${app_ex_cam_pkgs_CFLAGS_OTHER})
IF (INSTALL_EXAMPLE_APP)
INSTALL(TARGETS nnstreamer_example_cam RUNTIME DESTINATION ${EXAMPLE_EXEC_PREFIX})
-# demo app
+pkg_check_modules(app_ex_imglabel_pkgs gstreamer-1.0 glib-2.0 REQUIRED)
+
ADD_EXECUTABLE(nnstreamer_example_decoder_image_labelling nnstreamer_example_decoder_image_labelling.c)
-TARGET_LINK_LIBRARIES(nnstreamer_example_decoder_image_labelling ${apppkgs_LIBRARIES})
-TARGET_INCLUDE_DIRECTORIES(nnstreamer_example_decoder_image_labelling PUBLIC ${apppkgs_INCLUDE_DIRS})
-TARGET_COMPILE_OPTIONS(nnstreamer_example_decoder_image_labelling PUBLIC ${apppkgs_CFLAGS_OTHER})
+TARGET_LINK_LIBRARIES(nnstreamer_example_decoder_image_labelling ${app_ex_imglabel_pkgs_LIBRARIES})
+TARGET_INCLUDE_DIRECTORIES(nnstreamer_example_decoder_image_labelling PUBLIC ${app_ex_imglabel_pkgs_INCLUDE_DIRS})
+TARGET_COMPILE_OPTIONS(nnstreamer_example_decoder_image_labelling PUBLIC ${app_ex_imglabel_pkgs_CFLAGS_OTHER})
IF (INSTALL_EXAMPLE_APP)
INSTALL(TARGETS nnstreamer_example_decoder_image_labelling RUNTIME DESTINATION ${EXAMPLE_EXEC_PREFIX})
-# demo app
+pkg_check_modules(app_ex_filter_pkgs gstreamer-1.0 glib-2.0 REQUIRED)
+
ADD_EXECUTABLE(nnstreamer_example_filter nnstreamer_example_filter.c)
-TARGET_LINK_LIBRARIES(nnstreamer_example_filter ${apppkgs_LIBRARIES})
-TARGET_INCLUDE_DIRECTORIES(nnstreamer_example_filter PUBLIC ${apppkgs_INCLUDE_DIRS})
-TARGET_COMPILE_OPTIONS(nnstreamer_example_filter PUBLIC ${apppkgs_CFLAGS_OTHER})
+TARGET_LINK_LIBRARIES(nnstreamer_example_filter ${app_ex_filter_pkgs_LIBRARIES})
+TARGET_INCLUDE_DIRECTORIES(nnstreamer_example_filter PUBLIC ${app_ex_filter_pkgs_INCLUDE_DIRS})
+TARGET_COMPILE_OPTIONS(nnstreamer_example_filter PUBLIC ${app_ex_filter_pkgs_CFLAGS_OTHER})
IF (INSTALL_EXAMPLE_APP)
INSTALL(TARGETS nnstreamer_example_filter RUNTIME DESTINATION ${EXAMPLE_EXEC_PREFIX})
+pkg_check_modules(app_ex_performance_pkgs gstreamer-1.0 glib-2.0 REQUIRED)
+
SET(EXAMPLE_APP_NAME "nnstreamer_example_filter_performance_profile")
ADD_EXECUTABLE(${EXAMPLE_APP_NAME} ${EXAMPLE_APP_NAME}.c)
-TARGET_LINK_LIBRARIES(${EXAMPLE_APP_NAME} ${apppkgs_LIBRARIES})
-TARGET_INCLUDE_DIRECTORIES(${EXAMPLE_APP_NAME} PUBLIC ${apppkgs_INCLUDE_DIRS})
-TARGET_COMPILE_OPTIONS(${EXAMPLE_APP_NAME} PUBLIC ${apppkgs_CFLAGS_OTHER})
+TARGET_LINK_LIBRARIES(${EXAMPLE_APP_NAME} ${app_ex_performance_pkgs_LIBRARIES})
+TARGET_INCLUDE_DIRECTORIES(${EXAMPLE_APP_NAME} PUBLIC ${app_ex_performance_pkgs_INCLUDE_DIRS})
+TARGET_COMPILE_OPTIONS(${EXAMPLE_APP_NAME} PUBLIC ${app_ex_performance_pkgs_CFLAGS_OTHER})
IF (INSTALL_EXAMPLE_APP)
INSTALL(TARGETS ${EXAMPLE_APP_NAME} RUNTIME DESTINATION ${EXAMPLE_EXEC_PREFIX})
-# demo app
-pkg_check_modules(cairo_pkg REQUIRED cairo)
+pkg_check_modules(app_ex_obj_pkgs gstreamer-1.0 gstreamer-video-1.0 glib-2.0 cairo REQUIRED)
ADD_EXECUTABLE(nnstreamer_example_object_detection nnstreamer_example_object_detection.cc)
-TARGET_LINK_LIBRARIES(nnstreamer_example_object_detection ${apppkgs_LIBRARIES} ${cairo_pkg_LIBRARIES})
-TARGET_INCLUDE_DIRECTORIES(nnstreamer_example_object_detection PUBLIC ${apppkgs_INCLUDE_DIRS} ${cairo_pkg_INCLUDE_DIRS})
-TARGET_COMPILE_OPTIONS(nnstreamer_example_object_detection PUBLIC ${apppkgs_CFLAGS_OTHER})
+TARGET_LINK_LIBRARIES(nnstreamer_example_object_detection ${app_ex_obj_pkgs_LIBRARIES} m)
+TARGET_INCLUDE_DIRECTORIES(nnstreamer_example_object_detection PUBLIC ${app_ex_obj_pkgs_INCLUDE_DIRS})
+TARGET_COMPILE_OPTIONS(nnstreamer_example_object_detection PUBLIC ${app_ex_obj_pkgs_CFLAGS_OTHER})
IF (INSTALL_EXAMPLE_APP)
INSTALL(TARGETS nnstreamer_example_object_detection RUNTIME DESTINATION ${EXAMPLE_EXEC_PREFIX})
+pkg_check_modules(app_ex_sink_pkgs gstreamer-1.0 gstreamer-app-1.0 glib-2.0 REQUIRED)
+
# example 1
ADD_EXECUTABLE(nnstreamer_sink_example nnstreamer_sink_example.c)
-TARGET_LINK_LIBRARIES(nnstreamer_sink_example ${apppkgs_LIBRARIES})
-TARGET_INCLUDE_DIRECTORIES(nnstreamer_sink_example PUBLIC ${apppkgs_INCLUDE_DIRS})
-TARGET_COMPILE_OPTIONS(nnstreamer_sink_example PUBLIC ${apppkgs_CFLAGS_OTHER})
+TARGET_LINK_LIBRARIES(nnstreamer_sink_example ${app_ex_sink_pkgs_LIBRARIES})
+TARGET_INCLUDE_DIRECTORIES(nnstreamer_sink_example PUBLIC ${app_ex_sink_pkgs_INCLUDE_DIRS})
+TARGET_COMPILE_OPTIONS(nnstreamer_sink_example PUBLIC ${app_ex_sink_pkgs_CFLAGS_OTHER})
# example 2
ADD_EXECUTABLE(nnstreamer_sink_example_play nnstreamer_sink_example_play.c)
-TARGET_LINK_LIBRARIES(nnstreamer_sink_example_play ${apppkgs_LIBRARIES})
-TARGET_INCLUDE_DIRECTORIES(nnstreamer_sink_example_play PUBLIC ${apppkgs_INCLUDE_DIRS})
-TARGET_COMPILE_OPTIONS(nnstreamer_sink_example_play PUBLIC ${apppkgs_CFLAGS_OTHER})
+TARGET_LINK_LIBRARIES(nnstreamer_sink_example_play ${app_ex_sink_pkgs_LIBRARIES})
+TARGET_INCLUDE_DIRECTORIES(nnstreamer_sink_example_play PUBLIC ${app_ex_sink_pkgs_INCLUDE_DIRS})
+TARGET_COMPILE_OPTIONS(nnstreamer_sink_example_play PUBLIC ${app_ex_sink_pkgs_CFLAGS_OTHER})
IF (INSTALL_EXAMPLE_APP)
INSTALL(TARGETS nnstreamer_sink_example nnstreamer_sink_example_play RUNTIME DESTINATION ${EXAMPLE_EXEC_PREFIX})
ENDIF(LIB_INSTALL_DIR)
FIND_PACKAGE(PkgConfig REQUIRED)
-SET(PKGAPP_MODULES
- nnstreamer
- gstreamer-1.0
- gstreamer-base-1.0
- gstreamer-controller-1.0
- gstreamer-video-1.0
- gstreamer-audio-1.0
- gstreamer-app-1.0
-)
-pkg_check_modules(apppkgs REQUIRED ${PKGAPP_MODULES})
ADD_SUBDIRECTORY(../example_sink ${CMAKE_CURRENT_BINARY_DIR}/example_sink)
ADD_SUBDIRECTORY(../example_cam ${CMAKE_CURRENT_BINARY_DIR}/example_cam)