Commit 5c1c3943 authored by Nicolas Fella's avatar Nicolas Fella
Browse files

Move upower backend cmake code to subfolder

Having the cmake code in the same directory as the source code makes
more sense semantically and simplifies the code a bit
parent 693b27c0
########################## UPower Backend #####################################
set(powerdevilupowerbackend_SRCS
${CMAKE_CURRENT_BINARY_DIR}/../powerdevil_debug.cpp
upower/upowersuspendjob.cpp
upower/login1suspendjob.cpp
upower/powerdevilupowerbackend.cpp
upower/udevqtclient.cpp
upower/udevqtdevice.cpp
upower/ddcutilbrightness.cpp
)
set_source_files_properties(
${CMAKE_CURRENT_SOURCE_DIR}/upower/dbus/org.freedesktop.UPower.xml
${CMAKE_CURRENT_SOURCE_DIR}/upower/dbus/org.freedesktop.UPower.Device.xml
PROPERTIES NO_NAMESPACE TRUE)
qt5_add_dbus_interface(powerdevilupowerbackend_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/upower/dbus/org.freedesktop.UPower.xml
upower_interface)
qt5_add_dbus_interface(powerdevilupowerbackend_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/upower/dbus/org.freedesktop.UPower.Device.xml
upower_device_interface)
qt5_add_dbus_interface(powerdevilupowerbackend_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/upower/dbus/org.freedesktop.UPower.KbdBacklight.xml
upower_kbdbacklight_interface)
## backlight helper executable
add_executable(backlighthelper upower/backlighthelper.cpp ${CMAKE_CURRENT_BINARY_DIR}/../powerdevil_debug.cpp ${backlighthelper_mocs})
target_link_libraries(backlighthelper Qt::Core KF5::AuthCore KF5::I18n)
install(TARGETS backlighthelper DESTINATION ${KAUTH_HELPER_INSTALL_DIR})
kauth_install_helper_files(backlighthelper org.kde.powerdevil.backlighthelper root)
kauth_install_actions(org.kde.powerdevil.backlighthelper ${CMAKE_CURRENT_SOURCE_DIR}/upower/backlight_helper_actions.actions)
## discrete gpu helper executable
add_executable(discretegpuhelper upower/discretegpuhelper.cpp ${CMAKE_CURRENT_BINARY_DIR}/../powerdevil_debug.cpp ${discretegpuhelper_mocs})
target_link_libraries(discretegpuhelper Qt::Core KF5::AuthCore)
install(TARGETS discretegpuhelper DESTINATION ${KAUTH_HELPER_INSTALL_DIR})
kauth_install_helper_files(discretegpuhelper org.kde.powerdevil.discretegpuhelper root)
kauth_install_actions(org.kde.powerdevil.discretegpuhelper ${CMAKE_CURRENT_SOURCE_DIR}/upower/discretegpu_helper_actions.actions)
add_library(powerdevilupowerbackend ${powerdevilupowerbackend_SRCS})
set_target_properties(powerdevilupowerbackend PROPERTIES PREFIX "")
target_link_libraries(powerdevilupowerbackend
Qt::Widgets
KF5::AuthCore
KF5::ConfigCore
KF5::CoreAddons
KF5::DBusAddons
KF5::I18n
${UDEV_LIBS}
powerdevilcore
)
if(DDCUTIL_FOUND)
target_link_libraries(powerdevilupowerbackend ${LIBDDCUTIL_LIBRARY})
endif()
install(TARGETS powerdevilupowerbackend DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf5/powerdevil)
add_subdirectory(upower)
set(powerdevilupowerbackend_SRCS
${CMAKE_BINARY_DIR}/daemon/powerdevil_debug.cpp
upowersuspendjob.cpp
login1suspendjob.cpp
powerdevilupowerbackend.cpp
udevqtclient.cpp
udevqtdevice.cpp
ddcutilbrightness.cpp
)
set_source_files_properties(
dbus/org.freedesktop.UPower.xml
dbus/org.freedesktop.UPower.Device.xml
PROPERTIES NO_NAMESPACE TRUE)
qt5_add_dbus_interface(powerdevilupowerbackend_SRCS
dbus/org.freedesktop.UPower.xml
upower_interface)
qt5_add_dbus_interface(powerdevilupowerbackend_SRCS
dbus/org.freedesktop.UPower.Device.xml
upower_device_interface)
qt5_add_dbus_interface(powerdevilupowerbackend_SRCS
dbus/org.freedesktop.UPower.KbdBacklight.xml
upower_kbdbacklight_interface)
## backlight helper executable
add_executable(backlighthelper backlighthelper.cpp ${CMAKE_BINARY_DIR}/daemon/powerdevil_debug.cpp)
target_link_libraries(backlighthelper Qt::Core KF5::AuthCore KF5::I18n)
install(TARGETS backlighthelper DESTINATION ${KAUTH_HELPER_INSTALL_DIR})
kauth_install_helper_files(backlighthelper org.kde.powerdevil.backlighthelper root)
kauth_install_actions(org.kde.powerdevil.backlighthelper backlight_helper_actions.actions)
## discrete gpu helper executable
add_executable(discretegpuhelper discretegpuhelper.cpp ${CMAKE_BINARY_DIR}/daemon/powerdevil_debug.cpp)
target_link_libraries(discretegpuhelper Qt::Core KF5::AuthCore)
install(TARGETS discretegpuhelper DESTINATION ${KAUTH_HELPER_INSTALL_DIR})
kauth_install_helper_files(discretegpuhelper org.kde.powerdevil.discretegpuhelper root)
kauth_install_actions(org.kde.powerdevil.discretegpuhelper discretegpu_helper_actions.actions)
add_library(powerdevilupowerbackend ${powerdevilupowerbackend_SRCS})
set_target_properties(powerdevilupowerbackend PROPERTIES PREFIX "")
target_link_libraries(powerdevilupowerbackend
Qt::Widgets
KF5::AuthCore
KF5::ConfigCore
KF5::CoreAddons
KF5::DBusAddons
KF5::I18n
${UDEV_LIBS}
powerdevilcore
)
if(DDCUTIL_FOUND)
target_link_libraries(powerdevilupowerbackend ${LIBDDCUTIL_LIBRARY})
endif()
install(TARGETS powerdevilupowerbackend DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf5/powerdevil)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment