CMake:访问qtvirtual键盘模块 [英] Cmake: accessing qtvirtual keyboard module

查看:249
本文介绍了CMake:访问qtvirtual键盘模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以做一个简单的示例,将qtvirtualkeyboard模块包含到cmake文件中吗?我想访问这些类,但无法弄清楚如何包含它们.

Can anyone do a simple example of including qtvirtualkeyboard module into a cmake file? I want to access the classes but I cannot figure out how to include it.

推荐答案

Qt的虚拟键盘只是可以通过

Qt's virtual keyboard is just another module of that can be loaded with find_package. The minimal example of cmake file being:

cmake_minimum_required(VERSION 3.5.0 FATAL_ERROR)

PROJECT("MyKeyboard")

set(CMAKE_PREFIX_PATH $ENV{QTDIR})

find_package(Qt5 COMPONENTS Widgets VirtualKeyboard REQUIRED)

set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)

add_executable("MyKeyboard"
    main.cpp
)

target_link_libraries("MyKeyboard" Qt5::Widgets Qt5::VirtualKeyboard)

这篇关于CMake:访问qtvirtual键盘模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆