I tried to include Qt6Linguist
to my qt application through Yocto.
Thus, I added in my CMakeLists.txt the following lines :
find_package(Qt6 6.4 REQUIRED COMPONENTS Quick Network VirtualKeyboard Concurrent Linguist)
and
target_link_libraries(app${PROJECT_NAME}
PRIVATE
Qt6::Quick
Qt6::VirtualKeyboard
Qt6::Concurrent
Qt6::Linguist
)
This is my recipe:
SUMMARY = "Recipe for myqtapp"
DESCRIPTION = "Provide qt executable of myapp"
LICENSE = "CLOSED"
FILESEXTRAPATHS:prepend := "${THISDIR}:"
inherit populate_sdk_qt6_base qt6-cmake qt6-paths
DEPENDS += "qtdeclarative-native qtvirtualkeyboard"
DEPENDS += "qttools"
SRC_URI = "git://[email protected]/myapp/myapp-QT.git;protocol=ssh;branch=develop;name=myapp;destsuffix=myapp"
#SRCREV = "${AUTOREV}"
SRCREV = "e0b57555d453f4469e0c76da4770eb4657cbcac3"
S = "${WORKDIR}/myappQt"
EXECUTABLE = "myappQt"
EXTRA_OECMAKE += " -DQT_DEBUG_FIND_PACKAGE=ON"
do_install() {
install -d ${D}/${bindir}
install -m 0755 ${WORKDIR}/build/app${EXECUTABLE} ${D}/${bindir}/app${EXECUTABLE}
ln -rs ${D}/${bindir}/app${EXECUTABLE} ${D}/${bindir}/b2qt
}
FILES_${PN} += " ${bindir}/app${EXECUTABLE} "
FILES_${PN} += " ${bindir}/b2qt "
However during do_configure step, there is a failure :
| -- Could NOT find Qt6Linguist (missing: Qt6Linguist_DIR)
| CMake Error at CMakeLists.txt:8 (find_package):
| Found package configuration file:
|
| /home/user/work/chat/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/myappQt/1.0-r0/recipe-sysroot/usr/lib/cmake/Qt6/Qt6Config.cmake
|
| but it set Qt6_FOUND to FALSE so package "Qt6" is considered to be NOT
| FOUND. Reason given by package:
|
| Failed to find required Qt component "Linguist".
|
| Expected Config file at
| "/home/user/work/chat/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/myappQt/1.0-r0/recipe-sysroot/usr/lib/cmake/Qt6Linguist/Qt6LinguistConfig.cmake"
| exist
|
|
|
| Configuring with --debug-find-pkg=Qt6Linguist might reveal details why the
| package was not found.
|
| Configuring with -DQT_DEBUG_FIND_PACKAGE=ON will print the values of some
| of the path variables that find_package uses to try and find the package.