94 lines
2.0 KiB
CMake
94 lines
2.0 KiB
CMake
|
|
cmake_minimum_required(VERSION 3.16)
|
|
|
|
project(kcm_openrc)
|
|
|
|
set(QT_MIN_VERSION "6.4.0")
|
|
set(KF_MIN_VERSION "6.4.0")
|
|
set(CMAKE_AUTOMOC ON)
|
|
set(CMAKE_AUTOUIC ON)
|
|
set(CMAKE_AUTORCC ON)
|
|
|
|
find_package(ECM ${KF_MIN_VERSION} REQUIRED NO_MODULE)
|
|
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)
|
|
set(GENERATE_MOC ON)
|
|
|
|
|
|
find_package(Qt6 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
|
|
Core
|
|
Quick
|
|
Svg
|
|
DBus
|
|
)
|
|
|
|
if (BUILD_TESTING)
|
|
find_package(Qt6 ${QT_MIN_VERSION} REQUIRED COMPONENTS Test)
|
|
add_compile_definitions("BUILD_TESTING")
|
|
endif()
|
|
|
|
find_package(KF6 ${KF_MIN_VERSION} REQUIRED COMPONENTS
|
|
I18n
|
|
KCMUtils
|
|
Config
|
|
ConfigWidgets
|
|
Auth
|
|
)
|
|
|
|
include(KDEInstallDirs)
|
|
include(KDECMakeSettings)
|
|
include(KDECompilerSettings NO_POLICY_SCOPE)
|
|
include(FeatureSummary)
|
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
|
|
|
set(openrc_kcm_SRCS
|
|
openrc_kcm.cpp
|
|
openrc_tree_item.cpp
|
|
openrc_service_model.cpp
|
|
)
|
|
|
|
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
|
|
|
|
kconfig_add_kcfg_files(openrc_kcm_SRCS GENERATE_MOC openrckcmsettings.kcfgc)
|
|
kcmutils_add_qml_kcm(kcm_openrc)
|
|
|
|
target_sources(kcm_openrc PRIVATE
|
|
${openrc_kcm_SRCS}
|
|
)
|
|
|
|
add_executable(openrc-actions-kauth openrc_actions.cpp)
|
|
target_link_libraries(openrc-actions-kauth
|
|
Qt6::Core
|
|
Qt6::DBus
|
|
|
|
KF6::CoreAddons
|
|
KF6::I18n
|
|
KF6::AuthCore
|
|
|
|
rc
|
|
)
|
|
|
|
|
|
target_link_libraries(kcm_openrc
|
|
Qt6::Core
|
|
Qt6::DBus
|
|
|
|
KF6::CoreAddons
|
|
KF6::I18n
|
|
KF6::KCMUtilsQuick
|
|
KF6::ConfigCore
|
|
KF6::ConfigWidgets
|
|
KF6::AuthCore
|
|
|
|
rc
|
|
)
|
|
|
|
if (BUILD_TESTING)
|
|
target_link_libraries(kcm_openrc Qt6::Test)
|
|
endif()
|
|
|
|
# install(TARGETS openrc-actions-kauth DESTINATION ${KAUTH_HELPER_INSTALL_DIR})
|
|
# install(TARGETS kcm_openrc DESTINATION ${KDE_INSTALL_PLUGINDIR}/plasma/kcms/systemsettings)
|
|
|
|
kauth_install_helper_files(openrc-actions-kauth tridentu.auth.openrc.service root)
|
|
kauth_install_actions(tridentu.auth.openrc.service tridentu.auth.openrc.service.actions)
|