Qt cross compile for Rasperry by not working for cmake project
Unsolved
Installation and Deployment
-
'm trying to cross compile a project for a raspberry pi 4 from my ubuntu host machine (following this tutorial: https://www.interelectronix.com/qt-515-cross-compilation-raspberry-compute-module-4-ubuntu-20-lts.html). I have cross-compiled qt on my host and can now create a sample project in Qt-creator, compile it, deploy it on my host system and run it without any problems. But if I select Cmake instead of Qmake as build system, I get errors during the build, e.g.:
07:54:57: Running steps for project untitled... 07:54:57: Starting: "/usr/bin/cmake" --build /home/user/Qt-Projects/cmakeTestProject/build-untitled-RaspberryPi4_Qt5_15-Debug --target all [1/5 29.6/sec] Automatic MOC and UIC for target untitled FAILED: CMakeFiles/untitled_autogen untitled_autogen/mocs_compilation.cpp cd /home/user/Qt-Projects/cmakeTestProject/build-untitled-RaspberryPi4_Qt5_15-Debug && /usr/bin/cmake -E cmake_autogen /home/user/Qt-Projects/cmakeTestProject/build-untitled-RaspberryPi4_Qt5_15-Debug/CMakeFiles/untitled_autogen.dir/AutogenInfo.json Debug AutoMoc subprocess error ------------------------ The moc process failed to compile "SRC:/mainwindow.h" into "BIN:/untitled_autogen/EWIEGA46WW/moc_mainwindow.cpp" Command ------- /opt/Qt-CrossCompile-RaspberryPi/raspberrypi4/sysroot/usr/lib/qt5/bin/moc -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -I/home/user/Qt-Projects/cmakeTestProject/build-untitled-RaspberryPi4_Qt5_15-Debug -I/home/user/Qt-Projects/cmakeTestProject/untitled -I/opt/Qt-CrossCompile-RaspberryPi/raspberrypi4/sysroot/usr/include/arm-linux-gnueabihf/qt5 -I/opt/Qt-CrossCompile-RaspberryPi/raspberrypi4/sysroot/usr/include/arm-linux-gnueabihf/qt5/QtWidgets -I/opt/Qt-CrossCompile-RaspberryPi/raspberrypi4/sysroot/usr/include/arm-linux-gnueabihf/qt5/QtGui -I/opt/Qt-CrossCompile-RaspberryPi/raspberrypi4/sysroot/usr/include/arm-linux-gnueabihf/qt5/QtCore -I/opt/Qt-CrossCompile-RaspberryPi/raspberrypi4/sysroot/usr/lib/arm-linux-gnueabihf/qt5/mkspecs/linux-g++ -I/opt/Qt-CrossCompile-RaspberryPi/raspberrypi4/tools/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.4.1 -I/opt/Qt-CrossCompile-RaspberryPi/raspberrypi4/tools/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.4.1/arm-linux-gnueabihf -I/opt/Qt-CrossCompile-RaspberryPi/raspberrypi4/tools/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.4.1/backward -I/opt/Qt-CrossCompile-RaspberryPi/raspberrypi4/tools/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/lib/gcc/arm-linux-gnueabihf/7.4.1/include -I/opt/Qt-CrossCompile-RaspberryPi/raspberrypi4/tools/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/lib/gcc/arm-linux-gnueabihf/7.4.1/include-fixed -I/opt/Qt-CrossCompile-RaspberryPi/raspberrypi4/tools/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include -I/opt/Qt-CrossCompile-RaspberryPi/raspberrypi4/sysroot/usr/include/arm-linux-gnueabihf -I/opt/Qt-CrossCompile-RaspberryPi/raspberrypi4/sysroot/usr/include --include /home/user/Qt-Projects/cmakeTestProject/build-untitled-RaspberryPi4_Qt5_15-Debug/untitled_autogen/moc_predefs.h -p ./ -o /home/user/Qt-Projects/cmakeTestProject/build-untitled-RaspberryPi4_Qt5_15-Debug/untitled_autogen/EWIEGA46WW/moc_mainwindow.cpp /home/user/Qt-Projects/cmakeTestProject/untitled/mainwindow.h Output ------ /opt/Qt-CrossCompile-RaspberryPi/raspberrypi4/sysroot/usr/lib/qt5/bin/moc: 1: Syntax error: "(" unexpected (expecting ")")
Do you have any idea what's going on here?