Using cmake3eclipse together with environment setup scripts from yocto

26 views
Skip to first unread message

Paul Groskopf

unread,
Oct 27, 2020, 11:08:59 AM10/27/20
to cmake4eclipse user mailing list

Hi,

I have a eclipse cmake project that builds with cmake4eclipse. It is a cross compiled project for embedded linux and I'm building inside docker container. The linux distribution is generated with Yocto. From which I generate a SDK that my eclipse project is supposed to use. Yocto is generating a script file that can be sourced and used to guide cmake to generate the correct cross compilation.

My problem is that I cannot see how I can get this to work together with cmake4eclipse. How can I source the environment script before launching the cmake builder

I'm very reluctant to source the environment before launching eclipse since I would like to change between different SDK/Cross compiler based on the selected build configuration.

Thanks!

15 knots

unread,
Oct 27, 2020, 3:37:49 PM10/27/20
to cmake4eclipse user mailing list
Am Di., 27. Okt. 2020 um 16:09 Uhr schrieb Paul Groskopf <pa...@groskopf-embedded.com>:

Hi,

I have a eclipse cmake project that builds with cmake4eclipse. It is a cross compiled project for embedded linux and I'm building inside docker container. The linux distribution is generated with Yocto. From which I generate a SDK that my eclipse project is supposed to use. Yocto is generating a script file that can be sourced and used to guide cmake to generate the correct cross compilation.

My problem is that I cannot see how I can get this to work together with cmake4eclipse. How can I source the environment script before launching the cmake builder

Java does not provide a way to 'source an environment script'. It is not bash/sh. And modifying cmake4eclipse to invoke bash and make it run the environment script before launching cmake won't solve your issue: The sourced environment variables exist only inside the bash process.
The way to go here is using toolchain files [1]. You may add a CMAKE_TOOLCHAIN_FILE=path/to/file entry on the symbols tab. If you are lucky, Yocto can generate one for You (I am not using Yocto, so I do not know).

/ Martin

Reply all
Reply to author
Forward
0 new messages