CMakeLists.txt 1.51 KB
Newer Older
1
2
3
# SPDX-FileCopyrightText: 2020 Volker Krause <vkrause@kde.org>
# SPDX-License-Identifier: BSD-3-Clause

4
5
add_subdirectory(qml)

6
7
8
set(solidextras_srcs
    brightnessmanager.cpp
    lockmanager.cpp
9
    networkstatus.cpp
10
11
12
)

if (ANDROID)
13
    add_subdirectory(android)
14
15
16
    list(APPEND solidextras_srcs
        androidbrightnessbackend.cpp
        androidlockbackend.cpp
17
        networkstatus_android.cpp
18
19
20
21
22
    )
else()
    list(APPEND solidextras_srcs
        solidbrightnessbackend.cpp
        solidlockbackend.cpp
23
        networkstatus_dbus.cpp
24
25
26
    )
    qt5_add_dbus_interface(solidextras_srcs org.kde.Solid.PowerManagement.Actions.BrightnessControl.xml brightnesscontroldbusinterface)
    qt5_add_dbus_interface(solidextras_srcs org.freedesktop.ScreenSaver.xml screensaverdbusinterface)
27
28
29
30
31
32
33
34
35
endif()

add_library(SolidExtras ${solidextras_srcs})
generate_export_header(SolidExtras BASE_NAME SolidExtras)

if (TARGET KF5::NetworkManagerQt)
    set(HAVE_NM ON)
endif()
configure_file(config-solid-extras.h.in ${CMAKE_CURRENT_BINARY_DIR}/config-solid-extras.h)
36

37
38
39
40
41
42
target_include_directories(SolidExtras PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>")
target_link_libraries(SolidExtras PUBLIC Qt5::Core)

if (ANDROID)
    target_link_libraries(SolidExtras PRIVATE Qt5::AndroidExtras)
else ()
43
    target_link_libraries(SolidExtras PRIVATE Qt5::DBus)
44
45
46
    if (TARGET KF5::NetworkManagerQt)
        target_link_libraries(SolidExtras PRIVATE KF5::NetworkManagerQt)
    endif()
47
endif()
48

49
install(TARGETS SolidExtras ${KF5_INSTALL_TARGETS_DEFAULT_ARGS})