[CMake] Cross Compilation & Source file generators

Craig Scott craig.scott at crascit.com
Sat May 21 17:10:31 EDT 2016


There's also the technique described in this stack overflow question/answer:

http://stackoverflow.com/questions/36084785/building-a-tool-immediately-so-it-can-be-used-later-in-same-cmake-run

I'd probably recommend the superbuild approach used by Paraview though if
your build can be structured that way. With the superbuild approach, it's a
bit easier to tell what's going on. The method in the above link would only
be better if you really needed to keep everything in the one single build.




On Sat, May 21, 2016 at 11:10 PM, David E DeMarle <dave.demarle at kitware.com>
wrote:

> Take a look at paraview's internal copy of protobuf. We compile protoc in
> the host tools pass and then use it when we build libprotobuf in the cross
> compile pass.
> On May 20, 2016 10:14 PM, "Walter Gray" <chrysalisx at gmail.com> wrote:
>
>> A small addendum - The way I am currently solving this problem is by
>> replacing the version of protoc in the library folder for android with one
>> that works on the host machine, but this is really not the best since it
>> means that the library distribution is tied to the host AND the target.
>>
>> Thinking in terms of concepts, I think I would want a find_package that
>> understood the difference between finding a package for executing and
>> finding a package for linking, but that'd be a pretty fundamental change.
>>
>> On Fri, May 20, 2016 at 7:02 PM Walter Gray <chrysalisx at gmail.com> wrote:
>>
>>> I've got a project with a number of target platforms, including some
>>> that I have to cross-compile to such as android, that uses protobuf. If
>>> you're unfamiliar, the crux of the issue is that there is both a library,
>>> libprotobuf, and an 'compiler', protoc, that takes .proto files and
>>> generates a .h/.cc pair that are then included in the project.
>>>
>>> When cross compiling, want to use the libprotobuf that was compiled on
>>> andriod, but the protoc that was compiled for my host environment. How
>>> could this be achieved?
>>>
>>> Currently, my build machine has several different directories where I
>>> store the external libraries that have been compiled for the various
>>> platforms/compilers that we support (Libraries-arm32, Libraries-x64,
>>> Libraries-x64-vc14, ect).
>>>
>>> Solutions that require modifying protobuf's -config.cmake file are
>>> welcome, I've already submitted several PR's improving it. I'd like to
>>> establish what the best practice for this kind of situation is as I have
>>> the same issue with Flatbuffers.
>>>
>>> On a slightly unrelated note, is there some way to write something like
>>> the AUTOUIC system without modifying cmake itself? It would be lovely if
>>> all I had to do was include the .proto file in the source file list.
>>>
>>> Thanks!
>>> Walter
>>>
>>
>> --
>>
>> Powered by www.kitware.com
>>
>> Please keep messages on-topic and check the CMake FAQ at:
>> http://www.cmake.org/Wiki/CMake_FAQ
>>
>> Kitware offers various services to support the CMake community. For more
>> information on each offering, please visit:
>>
>> CMake Support: http://cmake.org/cmake/help/support.html
>> CMake Consulting: http://cmake.org/cmake/help/consulting.html
>> CMake Training Courses: http://cmake.org/cmake/help/training.html
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Follow this link to subscribe/unsubscribe:
>> http://public.kitware.com/mailman/listinfo/cmake
>>
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
>



-- 
Craig Scott
Melbourne, Australia
http://crascit.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20160522/03dbe1a9/attachment.html>


More information about the CMake mailing list