我有一个非常简单的QML应用程序,我正试图用Yocto(Kirkstone)& meta-qt 6(开放源码)层构建它。我现在遇到了CMake的问题&我很确定这是因为我的CmakeLists.txt不正确,即。目标不会被建造。
如果任何人已经成功地编译与meta-qt 6在一个食谱,我会很感激任何指针!
我的食谱:
SUMMARY = "QT QML Test Recipe"
LICENSE = "CLOSED"
SRC_URI = "file://CMakeLists.txt \
file://CMakeLists.txt.user \
file://main.cpp \
file://Main.qml \
"
DEPENDS += " packagegroup-qt6-modules "
RDEPENDS_${PN} += "qtwayland"
S = "${WORKDIR}"
# Not needed as install is handled by cmake..
# do_install:append() {
# install -d ${D}${bindir}
# install -m 0755${WORKDIR}/build/qt-qml-demo ${D}${bindir}
#}
inherit qt6-cmake
项目布局:
├── files
│ ├── CMakeLists.txt
│ ├── CMakeLists.txt.user
│ ├── main.cpp
│ └── Main.qml
└── qt-qml-demo_0.1.bb
我的CmakeLists.txt:
cmake_minimum_required(VERSION 3.16)
project(qt-qml-demo VERSION 0.1 LANGUAGES CXX)
set(CMAKE_AUTOMOC ON)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
include(CMakePrintHelpers)
set(PROJECT_VERSION_MAJOR 6)
set(PROJECT_VERSION_MINOR 2)
set(PROJECT_VERSION 6.2.4)
cmake_print_variables(PROJECT_SOURCE_DIR)
cmake_print_variables(PROJECT_VERSION_MAJOR)
# Should output WORKDIR
cmake_print_variables(${S})
install(TARGETS qt-qml-demo
RUNTIME DESTINATION "${S}"
BUNDLE DESTINATION "${S}"
LIBRARY DESTINATION "${S}"
)
set(CMAKE_AUTOMOC ON)
我的输出:
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /media/user/yocto/dir/meta-raspberrypi/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/qt-qml-demo/0.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- PROJECT_SOURCE_DIR="/media/user/yocto/dir/meta-raspberrypi/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/qt-qml-demo/0.1-r0"
-- PROJECT_VERSION_MAJOR="6"
$(PROJECT_SOURCE_DIR)
$(PROJECT_VERSION_MAJOR)
CMake Error at CMakeLists.txt:30 (install):
install TARGETS given target "qt-qml-demo" which does not exist.
-- Configuring incomplete, errors occurred!
See also "/media/user/yocto/dir/meta-raspberrypi/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/qt-qml-demo/0.1-r0/build/CMakeFiles/CMakeOutput.log".
WARNING: exit code 1 from a shell command.
+ bb_sh_exit_handler
+ ret=1
+ [ 1 != 0 ]
+ echo WARNING: exit code 1 from a shell command.
+ exit 1
1条答案
按热度按时间utugiqy61#
我相信我有一个可行的解决方案。谢谢你的评论。项目布局现在是:
我的CmakeLists.txt
& qt-qml-demo_0.1.bb
这将创建一个成功填充到映像的二进制文件。唯一突出的问题是main.cpp使用了不恰当的文件路径方法:
这在嵌入式目标(RPi 4)上不起作用。这应该是一个简单的修复,任何感兴趣的人都应该在未来的某个时候找到一个更新的配方here。
我相信这个答案可以改进,我会很高兴任何投入,但至少这可能是一个起点,为他人。