Warning, /plasma/powerdevil/daemon/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 add_definitions(-DTRANSLATION_DOMAIN=\"powerdevil\" -DQT_USE_QSTRINGBUILDER)
0002 
0003 include_directories(${CMAKE_CURRENT_SOURCE_DIR}
0004                     ${CMAKE_CURRENT_BINARY_DIR})
0005 
0006 add_subdirectory(actions)
0007 
0008 # target no.1 - powerdevil core library
0009 set(powerdevilcore_SRCS
0010     powerdevil_debug.cpp
0011     powerdevilaction.cpp
0012     powerdevilactionpool.cpp
0013     powerdevilbackendinterface.cpp
0014     powerdevilcore.cpp
0015     powerdevilpolicyagent.cpp
0016     powerdevilprofilegenerator.cpp
0017     powerdevilbrightnesslogic.cpp
0018     powerdevilscreenbrightnesslogic.cpp
0019     powerdevilkeyboardbrightnesslogic.cpp
0020     powerdevilpowermanagement.cpp
0021     brightnessosdwidget.cpp
0022     kwinkscreenhelpereffect.cpp
0023 )
0024 
0025 add_library(powerdevil_log_static STATIC)
0026 set_property(TARGET powerdevil_log_static PROPERTY POSITION_INDEPENDENT_CODE ON)
0027 target_link_libraries(powerdevil_log_static Qt::Core)
0028 ecm_qt_declare_logging_category(powerdevil_log_static
0029    HEADER powerdevil_debug.h
0030    IDENTIFIER POWERDEVIL
0031    CATEGORY_NAME org.kde.powerdevil
0032    DEFAULT_SEVERITY Warning
0033    DESCRIPTION "Powerdevil" EXPORT POWERDEVIL)
0034 
0035 kconfig_add_kcfg_files(powerdevilcore_SRCS ../PowerDevilSettings.kcfgc)
0036 
0037 # Action DBus Adaptors
0038 
0039 qt_add_dbus_interface(powerdevilcore_SRCS org.freedesktop.ScreenSaver.xml screenlocker_interface)
0040 
0041 add_library(powerdevilcore SHARED ${powerdevilcore_SRCS} powerdevil_debug.cpp)
0042 set_target_properties(powerdevilcore PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION 2)
0043 
0044 # not exported, so just make the deps public
0045 target_link_libraries(powerdevilcore
0046     KF5::Activities
0047     KF5::ConfigCore
0048     KF5::ConfigGui
0049     KF5::DBusAddons
0050     KF5::I18n
0051     KF5::Solid
0052     KF5::IdleTime
0053     KF5::GlobalAccel
0054     KF5::Screen
0055     KF5::Service
0056     KF5::WidgetsAddons
0057     KF5::Notifications
0058     KF5::XmlGui
0059     KF5::Kirigami2
0060     PW::KWorkspace
0061     XCB::DPMS
0062     powerdevil_log_static
0063 )
0064 
0065 if(HAVE_WIRELESS_SUPPORT)
0066     target_link_libraries(powerdevilcore
0067         KF5::NetworkManagerQt
0068         KF5::BluezQt
0069     )
0070 endif()
0071 
0072 if (XCB_FOUND) # kwin kscreen helper effect
0073     target_link_libraries(powerdevilcore XCB::XCB)
0074     if (QT_MAJOR_VERSION EQUAL "5")
0075         target_link_libraries(powerdevilcore Qt5::X11Extras)
0076     else()
0077        target_link_libraries(powerdevilcore Qt::GuiPrivate)
0078     endif()
0079 endif ()
0080 
0081 # target no.2 - powerdevil kded module
0082 set(powerdevil_SRCS
0083     powerdevil_debug.cpp
0084     powerdevilapp.cpp
0085     powerdevilfdoconnector.cpp
0086 )
0087 
0088 # DBus Adaptors
0089 qt_add_dbus_adaptor(powerdevil_SRCS org.kde.Solid.PowerManagement.xml powerdevilcore.h PowerDevil::Core)
0090 qt_add_dbus_adaptor(powerdevil_SRCS org.kde.Solid.PowerManagement.PolicyAgent.xml
0091                                          powerdevilpolicyagent.h PowerDevil::PolicyAgent
0092                                          powermanagementpolicyagentadaptor PowerManagementPolicyAgentAdaptor)
0093 
0094 qt_add_dbus_adaptor(powerdevil_SRCS org.freedesktop.PowerManagement.xml powerdevilfdoconnector.h PowerDevil::FdoConnector powermanagementfdoadaptor PowerManagementFdoAdaptor)
0095 qt_add_dbus_adaptor(powerdevil_SRCS org.freedesktop.PowerManagement.Inhibit.xml powerdevilfdoconnector.h PowerDevil::FdoConnector powermanagementinhibitadaptor PowerManagementInhibitAdaptor)
0096 
0097 # KAuth charge threshold helper
0098 add_executable(chargethresholdhelper chargethresholdhelper.cpp powerdevil_debug.cpp ${chargethresholdhelper_mocs})
0099 target_link_libraries(chargethresholdhelper Qt::Core KF5::AuthCore)
0100 install(TARGETS chargethresholdhelper DESTINATION ${KAUTH_HELPER_INSTALL_DIR})
0101 kauth_install_helper_files(chargethresholdhelper org.kde.powerdevil.chargethresholdhelper root)
0102 kauth_install_actions(org.kde.powerdevil.chargethresholdhelper chargethreshold_helper_actions.actions)
0103 
0104 # Backends
0105 add_subdirectory(backends)
0106 
0107 add_executable(powerdevil ${powerdevil_SRCS})
0108 set_target_properties(powerdevil PROPERTIES OUTPUT_NAME org_kde_powerdevil)
0109 configure_file(powerdevil.desktop.cmake
0110                ${CMAKE_CURRENT_BINARY_DIR}/powerdevil.desktop)
0111 
0112 target_link_libraries(powerdevil
0113     KF5::Crash
0114     KF5::ConfigCore
0115     KF5::CoreAddons
0116     KF5::I18n
0117     KF5::DBusAddons
0118     PW::KWorkspace
0119     powerdevilcore
0120 )
0121 if (XCB_FOUND)
0122     if (QT_MAJOR_VERSION EQUAL "5")
0123         target_link_libraries(powerdevil Qt5::X11Extras)
0124     else()
0125         target_link_libraries(powerdevil Qt::GuiPrivate)
0126     endif()
0127 endif ()
0128 
0129 target_link_libraries(powerdevil ${UDEV_LIBS})
0130 
0131 install(TARGETS powerdevil DESTINATION ${KDE_INSTALL_FULL_LIBEXECDIR})
0132 if (HAVE_LIBCAP)
0133     install(
0134     CODE "execute_process(
0135             COMMAND
0136                 ${SETCAP_EXECUTABLE}
0137                 CAP_WAKE_ALARM=+ep
0138                 \$ENV{DESTDIR}${KDE_INSTALL_FULL_LIBEXECDIR}/org_kde_powerdevil)"
0139     )
0140 endif()
0141 
0142 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/powerdevil.desktop
0143         DESTINATION ${KDE_INSTALL_AUTOSTARTDIR})
0144 install(TARGETS powerdevilcore ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
0145 
0146 # target no.3 - powerdevil ui library
0147 set(powerdevilui_SRCS
0148     powerdevilactionconfig.cpp
0149 )
0150 
0151 add_library(powerdevilui ${powerdevilui_SRCS})
0152 set_target_properties(powerdevilui PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR})
0153 
0154 # not exported, so just make the deps public
0155 target_link_libraries(powerdevilui
0156     PUBLIC
0157         Qt::Widgets
0158         KF5::ConfigCore
0159 )
0160 
0161 set(HAVE_XCB ${XCB_FOUND})
0162 configure_file(config-powerdevil.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-powerdevil.h )
0163 
0164 install(TARGETS powerdevilui ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
0165 ecm_install_configured_files(INPUT plasma-powerdevil.service.in @ONLY DESTINATION
0166         ${KDE_INSTALL_SYSTEMDUSERUNITDIR})