mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-05 20:51:25 -07:00
add basic cmake support
This commit is contained in:
parent
654c8edc6b
commit
64daecb266
26 changed files with 1242 additions and 0 deletions
23
cmake/Modules/FindSystemd.cmake
Normal file
23
cmake/Modules/FindSystemd.cmake
Normal file
|
@ -0,0 +1,23 @@
|
|||
#######
|
||||
# Find systemd service dir
|
||||
# sets variables
|
||||
# SYSTEMD_FOUND
|
||||
# SYSTEMD_SERVICES_INSTALL_DIR
|
||||
if (NOT SYSTEMD_FOUND)
|
||||
pkg_check_modules(SYSTEMD "systemd")
|
||||
endif(NOT SYSTEMD_FOUND)
|
||||
|
||||
if (SYSTEMD_FOUND AND "${SYSTEMD_SERVICES_INSTALL_DIR}" STREQUAL "")
|
||||
execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE}
|
||||
--variable=systemdsystemunitdir systemd
|
||||
OUTPUT_VARIABLE SYSTEMD_SERVICES_INSTALL_DIR)
|
||||
string(REGEX REPLACE "[ \t\n]+" "" SYSTEMD_SERVICES_INSTALL_DIR
|
||||
"${SYSTEMD_SERVICES_INSTALL_DIR}")
|
||||
elseif (NOT SYSTEMD_FOUND AND SYSTEMD_SERVICES_INSTALL_DIR)
|
||||
message (FATAL_ERROR "Variable SYSTEMD_SERVICES_INSTALL_DIR is\
|
||||
defined, but we can't find systemd using pkg-config")
|
||||
endif()
|
||||
|
||||
if (SYSTEMD_FOUND)
|
||||
message(STATUS "systemd services install dir: ${SYSTEMD_SERVICES_INSTALL_DIR}")
|
||||
endif(SYSTEMD_FOUND)
|
Loading…
Add table
Add a link
Reference in a new issue