OPTION(TIZEN "Enable Tizen build mode" OFF)
OPTION(DISABLE_TENSORFLOW_LITE "Disable tensorflow-lite support" OFF)
+OPTION(INSTALL_EXAMPLE_APP "Install example applications" OFF)
ADD_DEFINITIONS(-DVERSION="0.0.0")
ADD_SUBDIRECTORY(custom_example_passthrough)
ADD_SUBDIRECTORY(custom_example_scaler)
ADD_SUBDIRECTORY(custom_example_average)
+
+# 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-app-1.0
+)
+pkg_check_modules(apppkgs REQUIRED ${PKGAPP_MODULES})
+
ADD_SUBDIRECTORY(example_cam)
ADD_SUBDIRECTORY(example_sink)
ADD_SUBDIRECTORY(example_filter)
# example app for webcam
ADD_EXECUTABLE(nnstreamer_example_cam nnstreamer_example_cam.c)
-TARGET_LINK_LIBRARIES(nnstreamer_example_cam ${pkgs_LIBRARIES})
-TARGET_INCLUDE_DIRECTORIES(nnstreamer_example_cam PUBLIC ${pkgs_INCLUDE_DIRS})
-TARGET_COMPILE_OPTIONS(nnstreamer_example_cam PUBLIC ${pkgs_CFLAGS_OTHER})
+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})
-# do not install example app
-# INSTALL(TARGETS nnstreamer_example_cam RUNTIME DESTINATION ${EXEC_PREFIX})
+IF (INSTALL_EXAMPLE_APP)
+ INSTALL(TARGETS nnstreamer_example_cam RUNTIME DESTINATION ${EXEC_PREFIX})
+ENDIF (INSTALL_EXAMPLE_APP)
# demo app
ADD_EXECUTABLE(nnstreamer_example_filter nnstreamer_example_filter.c)
-TARGET_LINK_LIBRARIES(nnstreamer_example_filter ${pkgs_LIBRARIES})
-TARGET_INCLUDE_DIRECTORIES(nnstreamer_example_filter PUBLIC ${pkgs_INCLUDE_DIRS})
-TARGET_COMPILE_OPTIONS(nnstreamer_example_filter PUBLIC ${pkgs_CFLAGS_OTHER})
+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})
-# do not install example app
-# INSTALL(TARGETS nnstreamer_example_filter RUNTIME DESTINATION ${EXEC_PREFIX})
+IF (INSTALL_EXAMPLE_APP)
+ INSTALL(TARGETS nnstreamer_example_filter RUNTIME DESTINATION ${EXEC_PREFIX})
+ENDIF (INSTALL_EXAMPLE_APP)
# example 1
ADD_EXECUTABLE(nnstreamer_sink_example nnstreamer_sink_example.c)
-TARGET_LINK_LIBRARIES(nnstreamer_sink_example ${pkgs_LIBRARIES})
-TARGET_INCLUDE_DIRECTORIES(nnstreamer_sink_example PUBLIC ${pkgs_INCLUDE_DIRS})
-TARGET_COMPILE_OPTIONS(nnstreamer_sink_example PUBLIC ${pkgs_CFLAGS_OTHER})
+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})
# example 2
ADD_EXECUTABLE(nnstreamer_sink_example_play nnstreamer_sink_example_play.c)
-TARGET_LINK_LIBRARIES(nnstreamer_sink_example_play gstapp-1.0 ${pkgs_LIBRARIES})
-TARGET_INCLUDE_DIRECTORIES(nnstreamer_sink_example_play PUBLIC ${pkgs_INCLUDE_DIRS})
-TARGET_COMPILE_OPTIONS(nnstreamer_sink_example_play PUBLIC ${pkgs_CFLAGS_OTHER})
+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})
-# do not install sample app
-# INSTALL(TARGETS nnstreamer_sink_example nnstreamer_sink_example_play RUNTIME DESTINATION ${EXEC_PREFIX})
+IF (INSTALL_EXAMPLE_APP)
+ INSTALL(TARGETS nnstreamer_sink_example nnstreamer_sink_example_play RUNTIME DESTINATION ${EXEC_PREFIX})
+ENDIF (INSTALL_EXAMPLE_APP)
--- /dev/null
+CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
+
+PROJECT(nnstreamer_testapp C)
+
+OPTION(INSTALL_EXAMPLE_APP "Install example applications" ON)
+
+SET(PREFIX ${CMAKE_INSTALL_PREFIX})
+SET(EXEC_PREFIX "${PREFIX}/bin")
+SET(INCLUDEDIR "${PREFIX}/include/${PROJECT_NAME}")
+IF(LIB_INSTALL_DIR)
+ELSE(LIB_INSTALL_DIR)
+ SET(LIB_INSTALL_DIR "${PREFIX}/lib")
+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-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)
+ADD_SUBDIRECTORY(../example_filter ${CMAKE_CURRENT_BINARY_DIR}/example_filter)
--- /dev/null
+Name: nnstreamer_testapp
+Summary: test app for gstremaer plugins for neural networks
+Version: 0.0.1
+Release: 1
+Group: Applications/Multimedia
+Packager: MyungJoo Ham <myungjoo.ham@samsung.com>
+License: LGPL-2.1
+Source0: nnstreamer_testapp-%{version}.tar.gz
+Source1001: nnstreamer.manifest
+
+Requires: gstreamer >= 1.8.0
+Requires: nnstreamer
+Requires: gst-plugins-good
+Requires: gst-plugins-good-extra
+Requires: gst-plugins-base
+BuildRequires: pkg-config
+BuildRequires: pkgconfig(nnstreamer)
+BuildRequires: pkgconfig(gstreamer-1.0)
+BuildRequires: pkgconfig(gstreamer-video-1.0)
+BuildRequires: pkgconfig(gstreamer-app-1.0)
+BuildRequires: cmake
+
+%description
+NNStreamer is a set of gstreamer plugins to support general neural networks
+and their plugins in a gstreamer stream.
+
+%prep
+%setup -q
+cp %{SOURCE1001} .
+
+%build
+pushd nnstreamer_example/tizen_app_build_example
+mkdir -p build
+pushd build
+%cmake ..
+make %{?_smp_mflags}
+popd
+popd
+
+%install
+pushd nnstreamer_example/tizen_app_build_example
+pushd build
+%make_install
+popd
+popd
+
+%files
+%manifest nnstreamer.manifest
+%defattr(-,root,root,-)
+%{_bindir}/*
+
+%changelog
+* Wed Jul 18 2018 MyungJoo Ham <myungjoo.ham@samsung.com>
+- Tizen Test App Project Started