2014-12-01 19:55:22 +00:00
|
|
|
project(trdaemon)
|
|
|
|
|
|
|
|
if(WITH_SYSTEMD)
|
2016-04-23 16:13:25 +00:00
|
|
|
add_definitions(-DUSE_SYSTEMD)
|
2014-12-01 19:55:22 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
include_directories(
|
|
|
|
${CMAKE_SOURCE_DIR}
|
2014-12-02 20:42:33 +00:00
|
|
|
${CURL_INCLUDE_DIRS}
|
2014-12-01 19:55:22 +00:00
|
|
|
${EVENT2_INCLUDE_DIRS}
|
|
|
|
)
|
|
|
|
|
2015-04-04 17:43:56 +00:00
|
|
|
set(${PROJECT_NAME}_SOURCES
|
2014-12-01 19:55:22 +00:00
|
|
|
daemon.c
|
2015-12-29 02:04:37 +00:00
|
|
|
daemon-posix.c
|
|
|
|
daemon-win32.c
|
2015-04-04 17:43:56 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
if(WIN32)
|
2015-12-29 02:04:37 +00:00
|
|
|
set_source_files_properties(daemon-posix.c PROPERTIES HEADER_FILE_ONLY ON)
|
2015-04-04 17:43:56 +00:00
|
|
|
else()
|
2015-12-29 02:04:37 +00:00
|
|
|
set_source_files_properties(daemon-win32.c PROPERTIES HEADER_FILE_ONLY ON)
|
2015-04-04 17:43:56 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
set(${PROJECT_NAME}_HEADERS
|
|
|
|
daemon.h
|
2014-12-01 19:55:22 +00:00
|
|
|
)
|
|
|
|
|
2015-04-14 22:46:40 +00:00
|
|
|
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})
|
2015-04-04 17:43:56 +00:00
|
|
|
|
2014-12-01 19:55:22 +00:00
|
|
|
target_link_libraries(${TR_NAME}-daemon
|
|
|
|
${TR_NAME}
|
|
|
|
${EVENT2_LIBRARIES}
|
|
|
|
)
|
|
|
|
|
2016-12-19 02:53:19 +00:00
|
|
|
if(WITH_SYSTEMD)
|
|
|
|
target_include_directories(${TR_NAME}-daemon PRIVATE ${SYSTEMD_INCLUDE_DIRS})
|
|
|
|
target_link_libraries(${TR_NAME}-daemon ${SYSTEMD_LIBRARIES})
|
|
|
|
endif()
|
|
|
|
|
2015-04-14 22:46:40 +00:00
|
|
|
tr_win32_app_info(${PROJECT_NAME}_remote_WIN32_RC_FILE
|
|
|
|
"Transmission Utility ('remote')"
|
|
|
|
"${TR_NAME}-remote"
|
|
|
|
"${TR_NAME}-remote.exe")
|
|
|
|
|
|
|
|
add_executable(${TR_NAME}-remote remote.c ${${PROJECT_NAME}_remote_WIN32_RC_FILE})
|
2014-12-01 19:55:22 +00:00
|
|
|
|
|
|
|
target_link_libraries(${TR_NAME}-remote
|
|
|
|
${TR_NAME}
|
|
|
|
${CURL_LIBRARIES}
|
|
|
|
)
|
|
|
|
|
|
|
|
foreach(P daemon remote)
|
|
|
|
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()
|