kdeconnect-kde/core/CMakeLists.txt

105 lines
3 KiB
CMake
Raw Normal View History

2014-06-18 01:49:07 +01:00
add_definitions(-DTRANSLATION_DOMAIN=\"kdeconnect-core\")
set(debug_file_SRCS)
ecm_qt_declare_logging_category(
debug_file_SRCS HEADER kdeconnect_debug.h
IDENTIFIER KDECONNECT_CORE CATEGORY_NAME kdeconnect.core
DEFAULT_SEVERITY Warning
EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (core)")
2019-06-18 02:21:31 +01:00
set(KDECONNECT_PRIVATE_DBUS_ADDR unix:tmpdir=/tmp)
if(WIN32)
set(KDECONNECT_PRIVATE_DBUS_ADDR tcp:host=localhost,port=0)
endif()
2019-06-09 16:28:49 +01:00
set(KDECONNECT_PRIVATE_DBUS_NAME DBusKDEConnectOnly)
configure_file(dbushelper.h.in ${CMAKE_CURRENT_BINARY_DIR}/dbushelper.h)
add_subdirectory(backends/lan)
add_subdirectory(backends/loopback)
2023-07-13 13:56:02 +01:00
option(MDNS_ENABLED "Use MDNS for device discovery (under development)" OFF)
if (MDNS_ENABLED)
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS DNSSD)
endif()
option(BLUETOOTH_ENABLED "Bluetooth support for kdeconnect" OFF)
if(BLUETOOTH_ENABLED)
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Bluetooth)
add_subdirectory(backends/bluetooth)
endif()
option(LOOPBACK_ENABLED "Loopback backend enabled" OFF)
2015-03-10 04:59:36 +00:00
set(kdeconnectcore_SRCS
2015-02-24 06:14:22 +00:00
${backends_kdeconnect_SRCS}
backends/linkprovider.cpp
backends/devicelink.cpp
2015-07-05 14:23:53 +01:00
backends/pairinghandler.cpp
kdeconnectplugin.cpp
kdeconnectpluginconfig.cpp
pluginloader.cpp
kdeconnectconfig.cpp
dbushelper.cpp
networkpacket.cpp
filetransferjob.cpp
2019-06-02 15:02:21 +01:00
compositefiletransferjob.cpp
daemon.cpp
device.cpp
core_debug.cpp
notificationserverinfo.cpp
openconfig.cpp
${debug_file_SRCS}
)
add_library(kdeconnectcore ${kdeconnectcore_SRCS})
2019-04-30 18:03:24 +01:00
target_include_directories(kdeconnectcore PUBLIC ${PROJECT_SOURCE_DIR})
2019-04-30 18:03:24 +01:00
target_link_libraries(kdeconnectcore
PUBLIC
Qt${QT_MAJOR_VERSION}::Network
2023-04-15 11:57:52 +01:00
KF${QT_MAJOR_VERSION}::CoreAddons
${Qca_LIBRARY}
2023-04-15 11:57:52 +01:00
KF${QT_MAJOR_VERSION}::KIOCore
KF${QT_MAJOR_VERSION}::KIOGui
PRIVATE
Qt${QT_MAJOR_VERSION}::DBus
2023-04-15 11:57:52 +01:00
KF${QT_MAJOR_VERSION}::I18n
KF${QT_MAJOR_VERSION}::ConfigCore
)
if(WIN32)
target_link_libraries(kdeconnectcore PRIVATE ws2_32.lib) # winsock2
endif()
2023-04-15 11:57:52 +01:00
if(KF5KIO_FOUND OR KF6KIO_FOUND)
target_link_libraries(kdeconnectcore PUBLIC KF${QT_MAJOR_VERSION}::KIOCore KF${QT_MAJOR_VERSION}::KIOGui)
endif()
if (BLUETOOTH_ENABLED)
target_compile_definitions(kdeconnectcore PRIVATE -DKDECONNECT_BLUETOOTH)
target_link_libraries(kdeconnectcore PRIVATE Qt5::Bluetooth)
endif()
if (LOOPBACK_ENABLED)
target_compile_definitions(kdeconnectcore PRIVATE -DKDECONNECT_LOOPBACK)
endif()
if (MDNS_ENABLED)
target_compile_definitions(kdeconnectcore PRIVATE -DKDECONNECT_MDNS)
target_link_libraries(kdeconnectcore PRIVATE KF5::DNSSD)
endif()
set_target_properties(kdeconnectcore PROPERTIES
VERSION ${KDECONNECT_VERSION}
SOVERSION ${KDECONNECT_VERSION_MAJOR}
)
2015-09-10 14:51:38 +01:00
generate_export_header(kdeconnectcore EXPORT_FILE_NAME kdeconnectcore_export.h BASE_NAME KDEConnectCore)
install(TARGETS kdeconnectcore EXPORT kdeconnectLibraryTargets ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} LIBRARY NAMELINK_SKIP)