Skip to content
This repository has been archived by the owner on Aug 5, 2022. It is now read-only.

Commit

Permalink
Enable avb_streamhandler_demo in make install
Browse files Browse the repository at this point in the history
1. add below lib and exe for make install

/usr/lib64/libias-media_transport-avb_streamhandler.so
/usr/lib64/pluginias-media_transport-avb_configuration_reference.so
/usr/bin/avb_streamhandler_demo
2. setcap to /usr/bin/avb_streamhandler_demo
3. modify setcap.sh
  • Loading branch information
keerockl committed Oct 27, 2018
1 parent ab9a5fb commit 54be387
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.avb_configuration_reference.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ set_target_properties(ias-media_transport-avb_configuration_reference PROPERTIES
if (${IAS_IS_HOST_BUILD})
target_compile_options(ias-media_transport-avb_config_base PUBLIC -DIAS_HOST_BUILD=1)
endif()

install(TARGETS ias-media_transport-avb_configuration_reference DESTINATION ${CMAKE_INSTALL_LIBDIR})
2 changes: 2 additions & 0 deletions CMakeLists.avb_streamhandler.txt
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,5 @@ set_target_properties( ias-media_transport-avb_streamhandler PROPERTIES VERSION
target_link_libraries( ias-media_transport-avb_streamhandler ias-audio-common )
target_link_libraries( ias-media_transport-avb_streamhandler ias-media_transport-lib_ptp_daemon )
target_link_libraries( ias-media_transport-avb_streamhandler ias-media_transport-avb_helper )

install(TARGETS ias-media_transport-avb_streamhandler DESTINATION ${CMAKE_INSTALL_LIBDIR})
7 changes: 6 additions & 1 deletion CMakeLists.avb_streamhandler_demo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,9 @@ if (${IAS_IS_HOST_BUILD})
add_custom_command(TARGET avb_streamhandler_demo POST_BUILD
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/setcap.sh $<TARGET_FILE:avb_streamhandler_demo>
)
endif()
endif()

install(TARGETS avb_streamhandler_demo DESTINATION ${CMAKE_INSTALL_BINDIR})
install(CODE "execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/setcap.sh ${CMAKE_INSTALL_PREFIX}/bin/avb_streamhandler_demo)")


2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ endif()
#------------------------------------------------------------------
# avb_streamhandler main CMakeLists
#------------------------------------------------------------------

include(GNUInstallDirs)
include( CMakeLists.lib_ptp_daemon.txt )
include( CMakeLists.avb_helper.txt )
include( CMakeLists.avb_streamhandler.txt )
Expand Down
11 changes: 8 additions & 3 deletions setcap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,19 @@
if [ -x "$AVB_SETCAP_TOOL" ]; then
echo "Using setcap_tool defined on AVB_SETCAP_TOOL env var"
$AVB_SETCAP_TOOL $1 && exit
echo "Failed"
echo "Failed to set cap"
fi

which setcap_tool &> /dev/null
if [ $? -eq 0 ]; then
echo "Trying to use setcap_tool on PATH env var"
setcap_tool $1 && exit
echo "Failed"
echo "Failed to set cap"
fi
which setcap &> /dev/null
if [ $? -eq 0 ]; then
echo "running setcap on PATH env var"
setcap cap_net_admin,cap_net_raw,cap_sys_nice+ep $1 && exit
echo "Failed to set cap"
fi

echo "Warning: echo setcap_tool not installed"

0 comments on commit 54be387

Please sign in to comment.