<div dir="ltr">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.<div><br></div><div>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.</div><br><div class="gmail_quote"><div dir="ltr">On Fri, May 20, 2016 at 7:02 PM Walter Gray <<a href="mailto:chrysalisx@gmail.com" target="_blank">chrysalisx@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">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.<div><br></div><div>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?</div><div><br></div><div>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). </div><div><br></div><div>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.</div><div><br></div><div>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.</div><div><br></div><div>Thanks!</div></div><div dir="ltr"><div>Walter</div></div></blockquote></div></div>