File: CMakeLists.txt

package info (click to toggle)
transmission 3.00-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 33,160 kB
  • sloc: ansic: 81,055; objc: 18,449; cpp: 16,303; sh: 4,470; javascript: 4,281; makefile: 1,081; xml: 139
file content (55 lines) | stat: -rw-r--r-- 1,227 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
project(trdaemon)

if(WITH_SYSTEMD)
    add_definitions(-DUSE_SYSTEMD)
endif()

include_directories(
    ${CMAKE_SOURCE_DIR}
    ${CURL_INCLUDE_DIRS}
    ${EVENT2_INCLUDE_DIRS}
)

set(${PROJECT_NAME}_SOURCES
    daemon.c
    daemon-posix.c
    daemon-win32.c
)

if(WIN32)
    set_source_files_properties(daemon-posix.c PROPERTIES HEADER_FILE_ONLY ON)
else()
    set_source_files_properties(daemon-win32.c PROPERTIES HEADER_FILE_ONLY ON)
endif()

set(${PROJECT_NAME}_HEADERS
    daemon.h
)

tr_win32_app_info(${PROJECT_NAME}_WIN32_RC_FILE
    "Transmission Daemon"
    "${TR_NAME}-daemon"
    "${TR_NAME}-daemon.exe")

add_executable(${TR_NAME}-daemon
    ${${PROJECT_NAME}_SOURCES}
    ${${PROJECT_NAME}_HEADERS}
    ${${PROJECT_NAME}_WIN32_RC_FILE})

target_link_libraries(${TR_NAME}-daemon
    ${TR_NAME}
    ${EVENT2_LIBRARIES}
)

if(WITH_SYSTEMD)
    target_include_directories(${TR_NAME}-daemon PRIVATE ${SYSTEMD_INCLUDE_DIRS})
    target_link_libraries(${TR_NAME}-daemon ${SYSTEMD_LIBRARIES})
endif()

foreach(P daemon)
    install(TARGETS ${TR_NAME}-${P} DESTINATION ${CMAKE_INSTALL_BINDIR})

    if(INSTALL_DOC)
        install(FILES ${TR_NAME}-${P}.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
    endif()
endforeach()