Skip to contentSkip to conversation

ADT/SDK and cmake - generating the toolchain/cmake config

DISCUSSION Jonathan Austin 2 participants 3 messages Apr 1, 2014 – Apr 11, 2014

lore
Share & tools
lore
#0 lore raw

Hi all,

The ADT documentation walks you through building an 'app' using autoconf/make, and the environment setup script that is created as part of the SDK build contains all the necessary autofoo/environment variables. This is great, and I've worked through the autotools example happily. Thanks :)

What I can't find, though, is anything that does the equivalent for cmake. I'm new to cmake so could be missing something obvious, but after seeing the 'environment-setup-TARGET' files (the ones at /opt/poky/1.5.1/) I thought there might also be a cmake toolchain file (toolchain-TARGET.cmake, for example) or some other cmake-foo.

I can see that cmake support was merged for Eclipse/ADT, so it seems like cmake could be supported 'outside the IDE', but I can't quite see how what I ought to twiddle to do this. I found the tantalizingly named 'cmake_do_generate_toolchain_file()' and all the other relevant stuff in meta/classes/cmake.bbclass, but I don't know what the 'right' way to propagate all that stuff into the SDK/ADT would be.

Any help with getting started would be greatly appreciated.

Thanks
Jonny

#1 lore raw
Quoted 14 lines · Jonathan Austin

Hi all,

The ADT documentation walks you through building an 'app' using autoconf/make, and the environment setup script that is created as part of the SDK build contains all the necessary autofoo/environment variables. This is great, and I've worked through the autotools example happily. Thanks :)

What I can't find, though, is anything that does the equivalent for cmake. I'm new to cmake so could be missing something obvious, but after seeing the 'environment-setup-TARGET' files (the ones at /opt/poky/1.5.1/) I thought there might also be a cmake toolchain file (toolchain-TARGET.cmake, for example) or some other cmake-foo.

Quoted 8 lines

I can see that cmake support was merged for Eclipse/ADT, so it seems like cmake could be supported 'outside the IDE', but I can't quite see how what I ought to twiddle to do this. I found the tantalizingly named 'cmake_do_generate_toolchain_file()' and all the other relevant stuff in meta/classes/cmake.bbclass, but I don't know what the 'right' way to propagate all that stuff into the SDK/ADT would be.

Any help with getting started would be greatly appreciated.

This toolchain file builds gnuradio from an SDK:

https://github.com/gnuradio/gnuradio/blob/master/cmake/Toolchains/oe-sdk_cross.cmake

Does this help?

Philip

Quoted 4 lines

Thanks
Jonny

#2 lore raw

Hi Philip,

Quoted 22 lines · Philip Balister
Quoted 21 lines · Jonathan Austin

Hi all,

The ADT documentation walks you through building an 'app' using autoconf/make, and the environment setup script that is created as part of the SDK build contains all the necessary autofoo/environment variables. This is great, and I've worked through the autotools example happily. Thanks :)

What I can't find, though, is anything that does the equivalent for cmake. I'm new to cmake so could be missing something obvious, but after seeing the 'environment-setup-TARGET' files (the ones at /opt/poky/1.5.1/) I thought there might also be a cmake toolchain file (toolchain-TARGET.cmake, for example) or some other cmake-foo.

I can see that cmake support was merged for Eclipse/ADT, so it seems like cmake could be supported 'outside the IDE', but I can't quite see how what I ought to twiddle to do this. I found the tantalizingly named 'cmake_do_generate_toolchain_file()' and all the other relevant stuff in meta/classes/cmake.bbclass, but I don't know what the 'right' way to propagate all that stuff into the SDK/ADT would be.

Quoted 6 lines
Quoted 1 line

Any help with getting started would be greatly appreciated.

This toolchain file builds gnuradio from an SDK:

https://github.com/gnuradio/gnuradio/blob/master/cmake/Toolchains/oe-sdk_cross.cmake

That looks great, thanks.

I did run into problems with the CC and CXX strings, as for me those include lots of flags (ie spaces, confusing the CMake foo). I ended up adding new environment variables just for CMAKE to the environment setup file - what did you do for those? I basically used the same approach as is used in cmake.bbclass.

Jonny

Quoted 9 lines

Does this help?

Philip

Quoted 4 lines

Thanks
Jonny