source: trunk/daemon/CMakeLists.txt @ 14651

Last change on this file since 14651 was 14651, checked in by mikedld, 6 years ago

#5663: Rework directory watching in daemon

Implement BSD/Darwin (kqueue) and Windows (ReadDirectoryChanges?) mechanisms
for receiving directory change notifications. Use events instead of polling
for changes. Retry file parsing up to 3 times before giving up.

Huge thanks to missionsix for preparing first two versions of the patch.

File size: 1.5 KB
Line 
1project(trdaemon)
2
3if(WITH_SYSTEMD)
4    add_definitions(-DUSE_SYSTEMD_DAEMON)
5endif()
6
7include_directories(
8    ${CMAKE_SOURCE_DIR}
9    ${CURL_INCLUDE_DIRS}
10    ${EVENT2_INCLUDE_DIRS}
11)
12
13set(${PROJECT_NAME}_SOURCES
14    daemon.c
15    daemon-posix.c
16    daemon-win32.c
17)
18
19if(WIN32)
20    set_source_files_properties(daemon-posix.c PROPERTIES HEADER_FILE_ONLY ON)
21else()
22    set_source_files_properties(daemon-win32.c PROPERTIES HEADER_FILE_ONLY ON)
23endif()
24
25set(${PROJECT_NAME}_HEADERS
26    daemon.h
27)
28
29tr_win32_app_info(${PROJECT_NAME}_WIN32_RC_FILE
30    "Transmission Daemon"
31    "${TR_NAME}-daemon"
32    "${TR_NAME}-daemon.exe")
33
34add_executable(${TR_NAME}-daemon
35    ${${PROJECT_NAME}_SOURCES}
36    ${${PROJECT_NAME}_HEADERS}
37    ${${PROJECT_NAME}_WIN32_RC_FILE})
38
39set_target_properties(${TR_NAME}-daemon PROPERTIES
40    COMPILE_FLAGS "${SYSTEMD_DAEMON_CFLAGS}"
41    LINK_FLAGS "${SYSTEMD_DAEMON_LDFLAGS}"
42)
43
44target_link_libraries(${TR_NAME}-daemon
45    ${TR_NAME}
46    ${EVENT2_LIBRARIES}
47    ${SYSTEMD_DAEMON_LIBRARIES}
48)
49
50tr_win32_app_info(${PROJECT_NAME}_remote_WIN32_RC_FILE
51    "Transmission Utility ('remote')"
52    "${TR_NAME}-remote"
53    "${TR_NAME}-remote.exe")
54
55add_executable(${TR_NAME}-remote remote.c ${${PROJECT_NAME}_remote_WIN32_RC_FILE})
56
57target_link_libraries(${TR_NAME}-remote
58    ${TR_NAME}
59    ${CURL_LIBRARIES}
60)
61
62foreach(P daemon remote)
63    install(TARGETS ${TR_NAME}-${P} DESTINATION ${CMAKE_INSTALL_BINDIR})
64
65    if(INSTALL_DOC)
66        install(FILES ${TR_NAME}-${P}.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
67    endif()
68endforeach()
Note: See TracBrowser for help on using the repository browser.