fix: 修复依赖
This commit is contained in:
@@ -1,58 +1,83 @@
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
# SPDX-FileCopyrightText: 2026 pluvium27 <pluvium27@outlook.com>
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
|
||||
add_subdirectory(settings)
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
qt_add_library(heurams_static STATIC)
|
||||
ecm_add_qml_module(heurams_static
|
||||
URI top.pluv27.heurams.kiri
|
||||
GENERATE_PLUGIN_SOURCE
|
||||
QML_FILES
|
||||
qml/Main.qml
|
||||
DEPENDENCIES
|
||||
org.kde.kirigamiaddons.formcard
|
||||
org.kde.kirigamiaddons.statefulapp
|
||||
org.kde.kirigami
|
||||
top.pluv27.heurams.kiri.settings
|
||||
project(heurams-k VERSION 1.0.0)
|
||||
|
||||
set(QT_MIN_VERSION "6.8.0")
|
||||
set(KF_MIN_VERSION "6.12.0")
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
include(CTest)
|
||||
include(FeatureSummary)
|
||||
|
||||
find_package(ECM ${KF_MIN_VERSION} REQUIRED NO_MODULE)
|
||||
|
||||
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
|
||||
include(KDEInstallDirs)
|
||||
include(KDECMakeSettings)
|
||||
include(KDECompilerSettings NO_POLICY_SCOPE)
|
||||
include(ECMPoQmTools) # 新增
|
||||
include(ECMSetupVersion)
|
||||
include(ECMDeprecationSettings)
|
||||
include(ECMAddAndroidApk)
|
||||
include(ECMQmlModule)
|
||||
include(KDEClangFormat)
|
||||
include(KDEGitCommitHooks)
|
||||
|
||||
# 基础 Qt 组件
|
||||
find_package(Qt6 ${QT_MIN_VERSION} REQUIRED COMPONENTS
|
||||
Core
|
||||
Quick
|
||||
Gui
|
||||
Qml
|
||||
Network
|
||||
)
|
||||
|
||||
target_sources(heurams_static PRIVATE
|
||||
heuramsapplication.cpp
|
||||
heuramsapplication.h
|
||||
# KDE 框架
|
||||
find_package(KF6 ${KF_MIN_VERSION} REQUIRED COMPONENTS
|
||||
Config
|
||||
Kirigami2 # 注意:Kongress 用 Kirigami2
|
||||
I18n
|
||||
CoreAddons
|
||||
)
|
||||
|
||||
target_link_libraries(heurams_static PUBLIC
|
||||
Qt6::Quick
|
||||
KF6::I18n
|
||||
KF6::CoreAddons
|
||||
KF6::ConfigGui
|
||||
KirigamiAddonsStatefulApp
|
||||
)
|
||||
target_include_directories(heurams_static PUBLIC ${CMAKE_BINARY_DIR})
|
||||
find_package(KF6KirigamiAddons 1.0 REQUIRED)
|
||||
|
||||
# Android 特殊处理
|
||||
if (ANDROID)
|
||||
kirigami_package_breeze_icons(ICONS
|
||||
list-add
|
||||
help-about
|
||||
application-exit
|
||||
applications-graphics
|
||||
)
|
||||
find_package(OpenSSL REQUIRED) # QtNetwork 可能需要
|
||||
find_package(KF6 ${KF_MIN_VERSION} REQUIRED COMPONENTS ColorScheme)
|
||||
else()
|
||||
target_link_libraries(heurams_static PUBLIC
|
||||
Qt::Widgets
|
||||
KF6::I18nQml
|
||||
)
|
||||
find_package(Qt6 ${QT_MIN_VERSION} REQUIRED COMPONENTS Widgets)
|
||||
# 桌面版可以加这些,但不是必须
|
||||
# find_package(KF6 ${KF_MIN_VERSION} REQUIRED COMPONENTS Crash)
|
||||
endif()
|
||||
|
||||
kconfig_add_kcfg_files(heurams_static GENERATE_MOC heuramsconfig.kcfgc)
|
||||
# 可选提醒功能(如果你需要)
|
||||
# if(NOT ANDROID)
|
||||
# find_package(KF6 ${KF_MIN_VERSION} REQUIRED COMPONENTS Notifications)
|
||||
# endif()
|
||||
|
||||
add_executable(heurams main.cpp)
|
||||
target_link_libraries(heurams PUBLIC
|
||||
KirigamiApp
|
||||
heurams_static
|
||||
heurams_staticplugin
|
||||
heurams_settings
|
||||
heurams_settingsplugin
|
||||
)
|
||||
install(TARGETS heurams ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
|
||||
ecm_add_android_apk(heurams ANDROID_DIR ${CMAKE_SOURCE_DIR}/android)
|
||||
add_subdirectory(src)
|
||||
|
||||
# 安装 i18n 文件(如果有 po 目录)
|
||||
if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/po")
|
||||
ki18n_install(po)
|
||||
endif()
|
||||
|
||||
# 桌面文件安装(非 Android)
|
||||
if (NOT ANDROID)
|
||||
install(FILES top.pluv27.heurams.kiri.desktop DESTINATION ${KDE_INSTALL_APPDIR})
|
||||
install(FILES top.pluv27.heurams.kiri.metainfo.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
|
||||
endif()
|
||||
|
||||
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
|
||||
|
||||
# 代码格式化(可选)
|
||||
file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES src/*.cpp src/*.h)
|
||||
kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})
|
||||
kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)
|
||||
|
||||
Reference in New Issue
Block a user