[CMake] Install example apps to "EXAMPLE_EXEC_PREFIX".
authorMyungJoo Ham <myungjoo.ham@samsung.com>
Mon, 26 Nov 2018 07:16:31 +0000 (16:16 +0900)
committerMyungJoo Ham <myungjoo.ham@gmail.com>
Tue, 27 Nov 2018 09:36:06 +0000 (09:36 +0000)
Do not install example apps into /usr/bin, but to /usr/lib/nnstreamer/bin/

Partially addresses the third subitem of #866

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
15 files changed:
CMakeLists.txt
nnstreamer_example/custom_example_RNN/CMakeLists.txt
nnstreamer_example/custom_example_average/CMakeLists.txt
nnstreamer_example/custom_example_opencv/CMakeLists.txt
nnstreamer_example/custom_example_passthrough/CMakeLists.txt
nnstreamer_example/custom_example_scaler/CMakeLists.txt
nnstreamer_example/example_cam/CMakeLists.txt
nnstreamer_example/example_decoder_image_labelling/CMakeLists.txt
nnstreamer_example/example_filter/CMakeLists.txt
nnstreamer_example/example_filter_performance_profile/CMakeLists.txt
nnstreamer_example/example_object_detection/CMakeLists.txt
nnstreamer_example/example_sink/CMakeLists.txt
nnstreamer_example/tizen_app_build_example/CMakeLists.txt
packaging/nnstreamer.spec
packaging/nnstreamer_testapp.spec

index f415cee..c3f481b 100644 (file)
@@ -8,6 +8,14 @@ OPTION(ENABLE_MODEL_DOWNLOAD "Enable download the model files" ON)
 OPTION(INSTALL_EXAMPLE_APP "Install example applications" OFF)
 OPTION(ENABLE_TEST "Enable tests" ON)
 
+IF(INSTALL_EXAMPLE_APP)
+       IF(EXAMPLE_EXEC_PREFIX)
+               MESSAGE("Example application will be installed to ${EXAMPLE_EXEC_PREFIX}")
+       ELSE(EXAMPLE_EXEC_PREFIX)
+               SET(EXAMPLE_EXEC_PREFIX /usr/lib/nnstreamer/bin/)
+       ENDIF(EXAMPLE_EXEC_PREFIX)
+ENDIF(INSTALL_EXAMPLE_APP)
+
 SET(VERSION "0.0.3")
 ADD_DEFINITIONS(-DVERSION="${VERSION}")
 
index 5710682..068bd0c 100644 (file)
@@ -3,7 +3,6 @@ ADD_LIBRARY(dummyRNN SHARED dummy_RNN.c)
 TARGET_LINK_LIBRARIES(dummyRNN nnstreamer)
 
 INSTALL(TARGETS dummyRNN
-       RUNTIME DESTINATION ${EXEC_PREFIX}
        LIBRARY DESTINATION ${LIB_INSTALL_DIR}
        ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
        )
index aa3ce4f..58a421f 100644 (file)
@@ -3,7 +3,6 @@ ADD_LIBRARY(nnstreamer_customfilter_average SHARED nnstreamer_customfilter_examp
 TARGET_LINK_LIBRARIES(nnstreamer_customfilter_average nnstreamer)
 
 INSTALL(TARGETS nnstreamer_customfilter_average
-       RUNTIME DESTINATION ${EXEC_PREFIX}
        LIBRARY DESTINATION ${LIB_INSTALL_DIR}
        ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
        )
index 2be045d..ff89e3a 100644 (file)
@@ -9,13 +9,11 @@ TARGET_LINK_LIBRARIES(nnstreamer_customfilter_opencv_average ${opencv_pkg_LIBRAR
 TARGET_INCLUDE_DIRECTORIES(nnstreamer_customfilter_opencv_average PUBLIC ${opencv_pkg_INCLUDE_DIRS})
 
 INSTALL(TARGETS nnstreamer_customfilter_opencv_scaler
-       RUNTIME DESTINATION ${EXEC_PREFIX}
        LIBRARY DESTINATION ${LIB_INSTALL_DIR}
        ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
 )
 
 INSTALL(TARGETS nnstreamer_customfilter_opencv_average
-       RUNTIME DESTINATION ${EXEC_PREFIX}
        LIBRARY DESTINATION ${LIB_INSTALL_DIR}
        ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
 )
index 6d8f50a..3637bf3 100644 (file)
@@ -5,7 +5,6 @@ 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}
        LIBRARY DESTINATION ${LIB_INSTALL_DIR}
        ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
        )
index a495171..a5e1241 100644 (file)
@@ -7,7 +7,6 @@ ADD_LIBRARY(nnstreamer_customfilter_scaler_allocator SHARED nnstreamer_customfil
 TARGET_LINK_LIBRARIES(nnstreamer_customfilter_scaler_allocator nnstreamer)
 
 INSTALL(TARGETS nnstreamer_customfilter_scaler nnstreamer_customfilter_scaler_allocator
-       RUNTIME DESTINATION ${EXEC_PREFIX}
        LIBRARY DESTINATION ${LIB_INSTALL_DIR}
        ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
        )
index 72eb85c..b010555 100644 (file)
@@ -6,5 +6,5 @@ TARGET_INCLUDE_DIRECTORIES(nnstreamer_example_cam PUBLIC ${apppkgs_INCLUDE_DIRS}
 TARGET_COMPILE_OPTIONS(nnstreamer_example_cam PUBLIC ${apppkgs_CFLAGS_OTHER})
 
 IF (INSTALL_EXAMPLE_APP)
-       INSTALL(TARGETS nnstreamer_example_cam RUNTIME DESTINATION ${EXEC_PREFIX})
+       INSTALL(TARGETS nnstreamer_example_cam RUNTIME DESTINATION ${EXAMPLE_EXEC_PREFIX})
 ENDIF (INSTALL_EXAMPLE_APP)
index 0ce6023..d2fc05b 100644 (file)
@@ -6,5 +6,5 @@ TARGET_INCLUDE_DIRECTORIES(nnstreamer_example_decoder_image_labelling PUBLIC ${a
 TARGET_COMPILE_OPTIONS(nnstreamer_example_decoder_image_labelling PUBLIC ${apppkgs_CFLAGS_OTHER})
 
 IF (INSTALL_EXAMPLE_APP)
-       INSTALL(TARGETS nnstreamer_example_decoder_image_labelling RUNTIME DESTINATION ${EXEC_PREFIX})
+       INSTALL(TARGETS nnstreamer_example_decoder_image_labelling RUNTIME DESTINATION ${EXAMPLE_EXEC_PREFIX})
 ENDIF (INSTALL_EXAMPLE_APP)
index b7da6da..a245bbc 100644 (file)
@@ -6,5 +6,5 @@ TARGET_INCLUDE_DIRECTORIES(nnstreamer_example_filter PUBLIC ${apppkgs_INCLUDE_DI
 TARGET_COMPILE_OPTIONS(nnstreamer_example_filter PUBLIC ${apppkgs_CFLAGS_OTHER})
 
 IF (INSTALL_EXAMPLE_APP)
-       INSTALL(TARGETS nnstreamer_example_filter RUNTIME DESTINATION ${EXEC_PREFIX})
+       INSTALL(TARGETS nnstreamer_example_filter RUNTIME DESTINATION ${EXAMPLE_EXEC_PREFIX})
 ENDIF (INSTALL_EXAMPLE_APP)
index d0fa1ce..d0b5259 100644 (file)
@@ -6,5 +6,5 @@ TARGET_INCLUDE_DIRECTORIES(${EXAMPLE_APP_NAME} PUBLIC ${apppkgs_INCLUDE_DIRS})
 TARGET_COMPILE_OPTIONS(${EXAMPLE_APP_NAME} PUBLIC ${apppkgs_CFLAGS_OTHER})
 
 IF (INSTALL_EXAMPLE_APP)
-       INSTALL(TARGETS ${EXAMPLE_APP_NAME} RUNTIME DESTINATION ${EXEC_PREFIX})
+       INSTALL(TARGETS ${EXAMPLE_APP_NAME} RUNTIME DESTINATION ${EXAMPLE_EXEC_PREFIX})
 ENDIF (INSTALL_EXAMPLE_APP)
index ef9f82e..1968c06 100644 (file)
@@ -42,5 +42,6 @@ TARGET_INCLUDE_DIRECTORIES(nnstreamer_example_object_detection PUBLIC ${apppkgs_
 TARGET_COMPILE_OPTIONS(nnstreamer_example_object_detection PUBLIC ${apppkgs_CFLAGS_OTHER})
 
 IF (INSTALL_EXAMPLE_APP)
-       INSTALL(TARGETS nnstreamer_example_object_detection RUNTIME DESTINATION ${EXEC_PREFIX})
+       INSTALL(TARGETS nnstreamer_example_object_detection RUNTIME DESTINATION ${EXAMPLE_EXEC_PREFIX})
+       INSTALL(FILES get_model.sh gst-launch-object-detection.sh DESTINATION ${EXAMPLE_EXEC_PREFIX})
 ENDIF (INSTALL_EXAMPLE_APP)
index 01b2b0a..d9d0311 100644 (file)
@@ -13,5 +13,5 @@ TARGET_INCLUDE_DIRECTORIES(nnstreamer_sink_example_play PUBLIC ${apppkgs_INCLUDE
 TARGET_COMPILE_OPTIONS(nnstreamer_sink_example_play PUBLIC ${apppkgs_CFLAGS_OTHER})
 
 IF (INSTALL_EXAMPLE_APP)
-       INSTALL(TARGETS nnstreamer_sink_example nnstreamer_sink_example_play RUNTIME DESTINATION ${EXEC_PREFIX})
+       INSTALL(TARGETS nnstreamer_sink_example nnstreamer_sink_example_play RUNTIME DESTINATION ${EXAMPLE_EXEC_PREFIX})
 ENDIF (INSTALL_EXAMPLE_APP)
index 4ef3588..60be57c 100644 (file)
@@ -4,6 +4,14 @@ PROJECT(nnstreamer_testapp C)
 
 OPTION(INSTALL_EXAMPLE_APP "Install example applications" ON)
 
+IF(INSTALL_EXAMPLE_APP)
+       IF(EXAMPLE_EXEC_PREFIX)
+               MESSAGE("Example application will be installed to ${EXAMPLE_EXEC_PREFIX}")
+       ELSE(EXAMPLE_EXEC_PREFIX)
+               SET(EXAMPLE_EXEC_PREFIX /usr/lib/nnstreamer/bin/)
+       ENDIF(EXAMPLE_EXEC_PREFIX)
+ENDIF(INSTALL_EXAMPLE_APP)
+
 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
 SET(EXEC_PREFIX "${PREFIX}/bin")
 SET(INCLUDEDIR "${PREFIX}/include/nnstreamer")
index 9106de1..a79aab5 100644 (file)
@@ -89,7 +89,7 @@ mkdir -p build
 pushd build
 export GST_PLUGIN_PATH=$(pwd)
 export LD_LIBRARY_PATH=$(pwd):$(pwd)/gst/tensor_filter
-%cmake .. -DGST_INSTALL_DIR=%{gstlibdir} -DENABLE_MODEL_DOWNLOAD=OFF
+%cmake .. -DGST_INSTALL_DIR=%{gstlibdir} -DENABLE_MODEL_DOWNLOAD=OFF -DINSTALL_EXAMPLE_APP=ON
 make %{?_smp_mflags}
 %if 0%{?unit_test}
     ./tests/unittest_common
@@ -169,6 +169,7 @@ install build/gst/tensor_filter/*.a %{buildroot}%{_libdir}/
 %defattr(-,root,root,-)
 %license LICENSE
 %{_libdir}/*.so
+/usr/lib/nnstreamer/bin/*
 %exclude %{_libdir}/libtensor_filter_tflitecore.so
 
 %changelog
index dece07e..e0317f6 100644 (file)
@@ -48,7 +48,7 @@ popd
 %files
 %manifest nnstreamer.manifest
 %defattr(-,root,root,-)
-%{_bindir}/*
+/usr/lib/nnstreamer/bin/*
 
 %changelog
 * Wed Jul 18 2018 MyungJoo Ham <myungjoo.ham@samsung.com>