[CMake] Building a tool to run on the host when cross-compiling

Christopher Lansing c.lansing at gmail.com
Thu Jan 17 17:01:35 EST 2013


On Thu, Jan 17, 2013 at 4:54 PM, Bill Hoffman <bill.hoffman at kitware.com>wrote:

> On 1/17/2013 4:42 PM, Alexander Neundorf wrote:
>
>> Yes.
>> Or maybe you can do something with the ExternalProject support, to first
>> do a
>> native build in an external project, and then use the generated
>> executable in
>> the cross build.
>> I haven't tried this myself, but it might work.
>>
> I have been thinking that ExternalProject and cross-compiling might go
> very well together.  You could do host and target builds, and cross
> populate caches and set toolchains automatically in the ExternalProject.  I
> have not tried either, but ExternalProject did not exist when the original
> cross-compile stuff happened, and I think they could really complement each
> other.
>
> --
> Bill Hoffman
> Kitware, Inc.
> 28 Corporate Drive
> Clifton Park, NY 12065
> bill.hoffman at kitware.com
> http://www.kitware.com
> 518 881-4905 (Direct)
> 518 371-3971 x105
> Fax (518) 371-4573
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/**
> opensource/opensource.html<http://www.kitware.com/opensource/opensource.html>
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/**CMake_FAQ<http://www.cmake.org/Wiki/CMake_FAQ>
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/**listinfo/cmake<http://www.cmake.org/mailman/listinfo/cmake>
>

It definitely sounds like an interesting and promising combination. The one
snag I hit when I tried that was that the project I tried to use through
ExternalProject seemed to automatically pick up the toolchain that I'd
specified for the main project. If that's the way it works, then I'm
probably stuck.

If there's a way to make it not do that, then I probably missed an option
somewhere. I'll have to play around with it some more and see if I can find
a way to make that work.

Thanks,
Christopher
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20130117/fed80cf6/attachment-0001.htm>


More information about the CMake mailing list