1 From 09afc227e0880b12a98e18ee8182f89c3a80e3a6 Mon Sep 17 00:00:00 2001
2 From: Dennis Schridde <devurandom@gmx.net>
3 Date: Sat, 15 Dec 2018 23:21:17 +0100
4 Subject: [PATCH] CMakeLists.txt: Respect DESTDIR when creating stransmit
9 CMakeLists.txt | 20 ++++++--------------
10 scripts/haiUtil.cmake | 5 -----
11 2 files changed, 6 insertions(+), 19 deletions(-)
13 diff --git a/CMakeLists.txt b/CMakeLists.txt
14 index eb2582c..fe45919 100644
17 @@ -705,28 +705,20 @@ if ( ENABLE_CXX11 )
18 # For backward compatibility with the old name
20 set (REPLI_COMMAND create_symlink )
21 + # It appears impossible to get the filename component from the generator
22 + # expression $<TARGET_FILE:srt-live-transmit>, hence we predict it as:
23 + set (srt_live_transmit_name srt-live-transmit${CMAKE_EXECUTABLE_SUFFIX})
25 set (REPLI_COMMAND copy)
26 + set (srt_live_transmit_name $<TARGET_FILE:srt-live-transmit>)
29 set (stransmit_path $<TARGET_FILE_DIR:srt-live-transmit>/stransmit${CMAKE_EXECUTABLE_SUFFIX})
31 TARGET srt-live-transmit
33 - COMMAND ${CMAKE_COMMAND} -E ${REPLI_COMMAND} $<TARGET_FILE:srt-live-transmit> ${stransmit_path})
36 - message(STATUS "BACKWARD COMPATIBLE 'stransmit': will use symbolic link")
37 - srt_install_symlink(srt-live-transmit ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}/stransmit)
38 - elseif(${CMAKE_MAJOR_VERSION} LESS 3)
39 - message(FATAL_ERROR "Your system can't install symbolic link to 'stransmit', copy-on-install requires cmake at least 3.0.2")
41 - # This installation doesn't work with cmake earlier than 3.0
42 - # (looxlike cmake 2.8 somehow doesn't have a problem with resolving the $<TARGET_FILE_DIR:...>
43 - # inside the generated makefile, but does have problem with its own generated cmake_install.cmake :D)
44 - message(STATUS "BACKWARD COMPATIBLE 'stransmit': will use copying")
45 - install(PROGRAMS ${stransmit_path} DESTINATION ${CMAKE_INSTALL_BINDIR})
47 + COMMAND ${CMAKE_COMMAND} -E ${REPLI_COMMAND} ${srt_live_transmit_name} ${stransmit_path})
48 + install(FILES ${stransmit_path} DESTINATION ${CMAKE_INSTALL_BINDIR})
50 srt_add_application(srt-file-transmit ${VIRTUAL_srtsupport})
52 diff --git a/scripts/haiUtil.cmake b/scripts/haiUtil.cmake
53 index 417128d..f60bc11 100644
54 --- a/scripts/haiUtil.cmake
55 +++ b/scripts/haiUtil.cmake
56 @@ -48,5 +48,0 @@ FUNCTION(join_arguments outvar)
57 -macro(srt_install_symlink filepath sympath)
58 - install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${filepath} ${sympath})")
59 - install(CODE "message(\"-- Created symlink: ${sympath} -> ${filepath}\")")
60 -endmacro(srt_install_symlink)