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

Commit f7054be

Browse files
authored
Merge pull request #17 from keerockl/make_install_10_24
Enable avb_streamhandler_demo in make install
2 parents 7042483 + 54be387 commit f7054be

5 files changed

Lines changed: 19 additions & 5 deletions

CMakeLists.avb_configuration_reference.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,5 @@ set_target_properties(ias-media_transport-avb_configuration_reference PROPERTIES
2020
if (${IAS_IS_HOST_BUILD})
2121
target_compile_options(ias-media_transport-avb_config_base PUBLIC -DIAS_HOST_BUILD=1)
2222
endif()
23+
24+
install(TARGETS ias-media_transport-avb_configuration_reference DESTINATION ${CMAKE_INSTALL_LIBDIR})

CMakeLists.avb_streamhandler.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,5 @@ set_target_properties( ias-media_transport-avb_streamhandler PROPERTIES VERSION
8989
target_link_libraries( ias-media_transport-avb_streamhandler ias-audio-common )
9090
target_link_libraries( ias-media_transport-avb_streamhandler ias-media_transport-lib_ptp_daemon )
9191
target_link_libraries( ias-media_transport-avb_streamhandler ias-media_transport-avb_helper )
92+
93+
install(TARGETS ias-media_transport-avb_streamhandler DESTINATION ${CMAKE_INSTALL_LIBDIR})

CMakeLists.avb_streamhandler_demo.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,9 @@ if (${IAS_IS_HOST_BUILD})
2727
add_custom_command(TARGET avb_streamhandler_demo POST_BUILD
2828
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/setcap.sh $<TARGET_FILE:avb_streamhandler_demo>
2929
)
30-
endif()
30+
endif()
31+
32+
install(TARGETS avb_streamhandler_demo DESTINATION ${CMAKE_INSTALL_BINDIR})
33+
install(CODE "execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/setcap.sh ${CMAKE_INSTALL_PREFIX}/bin/avb_streamhandler_demo)")
34+
35+

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ endif()
7373
#------------------------------------------------------------------
7474
# avb_streamhandler main CMakeLists
7575
#------------------------------------------------------------------
76-
76+
include(GNUInstallDirs)
7777
include( CMakeLists.lib_ptp_daemon.txt )
7878
include( CMakeLists.avb_helper.txt )
7979
include( CMakeLists.avb_streamhandler.txt )

setcap.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,19 @@
1111
if [ -x "$AVB_SETCAP_TOOL" ]; then
1212
echo "Using setcap_tool defined on AVB_SETCAP_TOOL env var"
1313
$AVB_SETCAP_TOOL $1 && exit
14-
echo "Failed"
14+
echo "Failed to set cap"
1515
fi
16-
1716
which setcap_tool &> /dev/null
1817
if [ $? -eq 0 ]; then
1918
echo "Trying to use setcap_tool on PATH env var"
2019
setcap_tool $1 && exit
21-
echo "Failed"
20+
echo "Failed to set cap"
21+
fi
22+
which setcap &> /dev/null
23+
if [ $? -eq 0 ]; then
24+
echo "running setcap on PATH env var"
25+
setcap cap_net_admin,cap_net_raw,cap_sys_nice+ep $1 && exit
26+
echo "Failed to set cap"
2227
fi
2328

2429
echo "Warning: echo setcap_tool not installed"

0 commit comments

Comments
 (0)