Hi Darek Making the recipe compiling for cross and native and adding a DEPENDS from cross to native seems to be the cleanest and most Yocto-ish way to me.
Alternatively this patch would allow to run cross compiled executables with Qemu in the cmake project https://git.yoctoproject.org/poky-contrib/commit/?h=adrianf/devtool-ide&id=6c63df973d9530ecabc9480f8ba2aba3ff93952f. But that's not the most common approach. It's also possible to hack a cmake script which allows to pass a native tool-chain file for B. But this approach needs some hacks because cmake is designed to work with one tool-chain file only. I did that for a special use case, but I'm not aware of a public example. Regards, Adrian Darek Konopka <kono6...@kettering.edu> schrieb am Do., 19. Okt. 2023, 17:21: > Hello all, > > So I have a cmake project that uses an executable generated from a cmake > subproject. > My architecture is as such > ├── ProjectA > ├── projecta_1.0.bb > ├── files > ├── ProjectA > ├── CMakeLists.txt > ├── ProjectB > ├── CMakeLists.txt > My recipe is a standard recipe that inherits pkgconfig cmake > The issue that occurs is that when manually building ProjectA natively it > builds as expected, but when building it with yocto, during the do_compile > for ProjectA, it says it is missing the executable generated by ProjectB > located in /usr/bin/ProjBEXE (this executable is needed in order to compile > ProjectA). > > What did work is creating a projectb-native recipe that runs cmake-native, > and then have projecta depend on it, but I was wondering, is there a way to > have projecta_1.0.bb build the executable and use it within its own > cmake? Perhaps making projectB a package to have projectA use it? > NOTE: I am using yocto kirkstone > > > >
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#61421): https://lists.yoctoproject.org/g/yocto/message/61421 Mute This Topic: https://lists.yoctoproject.org/mt/102062177/21656 Mute #native:https://lists.yoctoproject.org/g/yocto/mutehashtag/native Mute #yocto:https://lists.yoctoproject.org/g/yocto/mutehashtag/yocto Mute #cmake:https://lists.yoctoproject.org/g/yocto/mutehashtag/cmake Mute #kirkstone:https://lists.yoctoproject.org/g/yocto/mutehashtag/kirkstone Mute #make:https://lists.yoctoproject.org/g/yocto/mutehashtag/make Group Owner: yocto+ow...@lists.yoctoproject.org Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-