user2840470
user2840470

Reputation: 969

CMake and custom sdk (yocto+arm) for building target applications

I have received an SDK that is used to build c++/c applications for an embedded linux device. This is all new to me so some of my terminology may be wrong.

I followed their instructions and the SDK installs on my linux (ubuntu) system in /opt/. The compiler they are using appears to be arm-poky-linux-gnueabi-gcc. Part of their SDK sets some environment variables, like $CC and CPP for compiling C/C++. The environment variables run something like arm-poky-linux-gnueabi-gcc -march=armv7-a (and a bunch of other flags).

My question is: how can I utilize this using cmakelists/cmake? I currently have an entire library and application that is built around cmake.

Upvotes: 0

Views: 612

Answers (1)

at-2500
at-2500

Reputation: 593

The SDK should come with a toolchain file for cmake (for example named toolchain.cmake).

When you first call your cmake, you force it to use the SDK like this: cmake -DCMAKE_TOOLCHAIN_FILE=/opt/???/toolchain.cmake.

Upvotes: 1

Related Questions