File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -35,6 +35,9 @@ if(NOT CMAKE_BUILD_TYPE)
3535endif (NOT CMAKE_BUILD_TYPE )
3636set (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "" )
3737
38+ # Use standard GNU install paths
39+ include (GNUInstallDirs )
40+
3841#find soapy sdr with modern cmake support
3942find_package (SoapySDR "0.8.0" CONFIG )
4043
Original file line number Diff line number Diff line change @@ -15,10 +15,10 @@ if (MSVC)
1515 target_include_directories (SoapySDRServer PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} /msvc )
1616endif ()
1717
18- install (TARGETS SoapySDRServer DESTINATION bin )
18+ install (TARGETS SoapySDRServer DESTINATION ${CMAKE_INSTALL_BINDIR} )
1919
2020#install man pages for the application executable
21- install (FILES SoapySDRServer.1 DESTINATION share/man /man1)
21+ install (FILES SoapySDRServer.1 DESTINATION ${CMAKE_INSTALL_MANDIR} /man1)
2222
2323########################################################################
2424# Thread config support
Original file line number Diff line number Diff line change 44option (ENABLE_SYSTEMD "Install systemd unit" ON )
55if (ENABLE_SYSTEMD)
66
7- if ("${CMAKE_INSTALL_PREFIX} " STREQUAL "/usr" )
8- set (SYSTEMD_UNIT_INSTALL_DIR /lib/systemd/system)
9- else ()
10- #source installs will use the install prefix
11- set (SYSTEMD_UNIT_INSTALL_DIR lib/systemd/system)
12- endif ()
13-
14- set (SYSTEMD_UNIT_DIR "${SYSTEMD_UNIT_INSTALL_DIR} " CACHE STRING "Directory to install systemd unit" )
7+ set (SYSTEMD_UNIT_DIR "lib/systemd/system" CACHE STRING "Directory to install systemd unit" )
158
169 configure_file (
1710 ${CMAKE_CURRENT_SOURCE_DIR} /SoapySDRServer.service.in
@@ -20,16 +13,19 @@ if(ENABLE_SYSTEMD)
2013
2114 install (FILES
2215 ${CMAKE_CURRENT_BINARY_DIR} /SoapySDRServer.service
23- DESTINATION ${SYSTEMD_UNIT_DIR} )
16+ DESTINATION " ${SYSTEMD_UNIT_DIR} " )
2417endif ()
2518
2619########################################################################
2720# Increase the sysctl network limits
2821########################################################################
2922option (ENABLE_SYSCTL "Install kernel tweaks for socket buffer sizes" ON )
3023if (ENABLE_SYSCTL)
24+
25+ set (SYSCTL_CONFIG_DIR "lib/sysctl.d" CACHE STRING "Directory to install sysctl.d configs" )
26+
3127 install (
3228 FILES SoapySDRServer.sysctl
3329 RENAME 10-SoapySDRServer.conf
34- DESTINATION lib/sysctl.d )
30+ DESTINATION " ${SYSCTL_CONFIG_DIR} " )
3531endif ()
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ Wants=network-online.target
44After=network-online.target
55
66[Service]
7- ExecStart=@CMAKE_INSTALL_PREFIX@/bin /SoapySDRServer --bind
7+ ExecStart=@CMAKE_INSTALL_FULL_BINDIR@ /SoapySDRServer --bind
88KillMode=process
99Restart=on-failure
1010LimitRTPRIO=99
You can’t perform that action at this time.
0 commit comments