[CMake] Cross Compilation & Source file generators

Walter Gray chrysalisx at gmail.com
Fri May 20 22:02:14 EDT 2016


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20160521/566d9de7/attachment.html>


More information about the CMake mailing list