36 Star 16 Fork 22

openKylin/kylin-virtual-keyboard

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
CMakeLists.txt 1.79 KB
一键复制 编辑 原始数据 按行查看 历史
cmake_minimum_required(VERSION 3.10.0)
project(kylin-virtual-keyboard LANGUAGES CXX)
OPTION(ENABLE_TEST "Build Test" OFF)
OPTION(ENABLE_QT6 "Build with Qt6 " OFF)
# set something
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# find packages
find_package(spdlog REQUIRED)
if (NOT spdlog_FOUND)
message(FATAL_ERROR "Spdlog not found!")
endif()
if (ENABLE_QT6)
find_package(QT NAMES Qt6 REQUIRED)
find_package(Qt6 COMPONENTS Core Gui Widgets Concurrent DBus Quick QuickControls2 Core5Compat REQUIRED)
else()
find_package(QT NAMES Qt5 REQUIRED)
find_package(Qt5 COMPONENTS Core Gui Widgets Concurrent DBus Quick QuickControls2 REQUIRED)
endif()
if (NOT Qt${QT_VERSION_MAJOR}_FOUND)
message(FATAL_ERROR "Qt${QT_VERSION_MAJOR} not found!")
return()
endif()
message(STATUS "Current Qt version: ${Qt${QT_VERSION_MAJOR}_VERSION}")
find_package(KF${QT_VERSION_MAJOR}WindowSystem REQUIRED)
if (NOT KF${QT_VERSION_MAJOR}WindowSystem_FOUND)
message(FATAL_ERROR "KF${QT_VERSION_MAJOR}WindowSystem not found!")
endif()
find_package(Fcitx5Core REQUIRED)
if (NOT Fcitx5Core_FOUND)
message(FATAL_ERROR "Fcitx5Core not found!")
endif()
find_package(PkgConfig REQUIRED)
if (QT_VERSION_MAJOR EQUAL 6)
pkg_check_modules(GSettings_QT REQUIRED IMPORTED_TARGET gsettings-qt${QT_VERSION_MAJOR})
else()
pkg_check_modules(GSettings_QT REQUIRED IMPORTED_TARGET gsettings-qt)
endif()
include(GNUInstallDirs)
include_directories(${GSettings_QT_INCLUDE_DIRS})
include("${FCITX_INSTALL_CMAKECONFIG_DIR}/Fcitx5Utils/Fcitx5CompilerSettings.cmake")
set(RESOURCES
${CMAKE_SOURCE_DIR}/resources.qrc
)
add_subdirectory(third-party)
add_subdirectory(data)
add_subdirectory(src)
if (ENABLE_TEST)
enable_testing()
add_subdirectory(test)
endif()
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/openkylin/kylin-virtual-keyboard.git
git@gitee.com:openkylin/kylin-virtual-keyboard.git
openkylin
kylin-virtual-keyboard
kylin-virtual-keyboard
upstream

搜索帮助