Skip to content

Commit

Permalink
[build] don't force RUNTIME targets in CMAKE_INSTALL_BINDIR
Browse files Browse the repository at this point in the history
It is implied by the target type:

> For regular executables, static libraries and shared libraries, the
> DESTINATION argument is not required. For these target types, when
> DESTINATION is omitted, a default destination will be taken from the
> appropriate variable from GNUInstallDirs, or set to a built-in default value
> if that variable is not defined.

https://cmake.org/cmake/help/v3.14/command/install.html#targets
  • Loading branch information
robUx4 authored and maxsharabayko committed Sep 9, 2022
1 parent 3170590 commit 286b43e
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions CMakeLists.txt
Expand Up @@ -1148,7 +1148,13 @@ endmacro()

macro(srt_add_program name)
srt_add_program_dont_install(${name} ${ARGN})
install(TARGETS ${name} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
if(NOT NEED_DESTINATION)
install(TARGETS ${name} RUNTIME)
elseif (DEFINED CMAKE_INSTALL_BINDIR)
install(TARGETS ${name} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
else()
message(WARNING "No location to install program ${name}")
endif()
endmacro()

macro(srt_make_application name)
Expand Down Expand Up @@ -1187,7 +1193,13 @@ endmacro()
macro(srt_add_application name) # ARGN=sources...
srt_add_program(${name} apps/${name}.cpp ${ARGN})
srt_make_application(${name})
install(TARGETS ${name} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
if(NOT NEED_DESTINATION)
install(TARGETS ${name} RUNTIME)
elseif (DEFINED CMAKE_INSTALL_BINDIR)
install(TARGETS ${name} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
else()
message(WARNING "No location to install program ${name}")
endif()
endmacro()

## FIXME: transmitmedia.cpp does not build on OpenBSD
Expand Down

0 comments on commit 286b43e

Please sign in to comment.