2023-01-01 19:49:48 +00:00
|
|
|
add_executable(${TR_NAME}-daemon)
|
|
|
|
|
|
|
|
target_sources(${TR_NAME}-daemon
|
|
|
|
PRIVATE
|
|
|
|
daemon.cc
|
|
|
|
daemon.h
|
|
|
|
daemon-posix.cc
|
|
|
|
daemon-win32.cc)
|
|
|
|
|
|
|
|
tr_allow_compile_if(
|
|
|
|
[=[[WIN32]]=]
|
|
|
|
daemon-win32.cc
|
|
|
|
[=[[NOT WIN32]]=]
|
|
|
|
daemon-posix.cc)
|
|
|
|
|
|
|
|
target_compile_definitions(${TR_NAME}-daemon
|
|
|
|
PRIVATE
|
|
|
|
$<$<BOOL:${WITH_SYSTEMD}>:USE_SYSTEMD>)
|
|
|
|
|
|
|
|
tr_target_compile_definitions_for_headers(${TR_NAME}-daemon
|
|
|
|
PRIVATE
|
|
|
|
sys/signalfd.h)
|
|
|
|
|
|
|
|
tr_target_compile_definitions_for_functions(${TR_NAME}-daemon
|
|
|
|
PRIVATE
|
|
|
|
daemon
|
|
|
|
syslog)
|
|
|
|
|
|
|
|
target_include_directories(${TR_NAME}-daemon SYSTEM
|
|
|
|
PRIVATE
|
|
|
|
$<$<BOOL:${WITH_SYSTEMD}>:${SYSTEMD_INCLUDE_DIRS}>)
|
2015-04-04 17:43:56 +00:00
|
|
|
|
2014-12-01 19:55:22 +00:00
|
|
|
target_link_libraries(${TR_NAME}-daemon
|
2023-01-01 19:49:48 +00:00
|
|
|
PRIVATE
|
|
|
|
${TR_NAME}
|
2023-01-02 16:23:51 +00:00
|
|
|
libevent::event
|
|
|
|
fmt::fmt-header-only
|
2023-01-01 19:49:48 +00:00
|
|
|
$<$<BOOL:${WITH_SYSTEMD}>:${SYSTEMD_LIBRARIES}>)
|
2014-12-01 19:55:22 +00:00
|
|
|
|
2023-01-01 19:49:48 +00:00
|
|
|
tr_win32_app_info(${TR_NAME}-daemon
|
|
|
|
"Transmission Daemon"
|
|
|
|
"${TR_NAME}-daemon"
|
|
|
|
"${TR_NAME}-daemon.exe")
|
2016-12-19 02:53:19 +00:00
|
|
|
|
2018-11-06 20:06:10 +00:00
|
|
|
foreach(P daemon)
|
2023-01-01 19:49:48 +00:00
|
|
|
install(
|
|
|
|
TARGETS ${TR_NAME}-${P}
|
|
|
|
DESTINATION ${CMAKE_INSTALL_BINDIR})
|
2014-12-01 19:55:22 +00:00
|
|
|
|
|
|
|
if(INSTALL_DOC)
|
2023-01-01 19:49:48 +00:00
|
|
|
install(
|
|
|
|
FILES ${TR_NAME}-${P}.1
|
|
|
|
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
|
2014-12-01 19:55:22 +00:00
|
|
|
endif()
|
|
|
|
endforeach()
|