<html><head></head><body>Hello,<br>
<br>
Yes, main reason is I had to hack FindProtobuf.cmake to make our existing project compile.<br>
Also since I need to make it "installable", I had to add some stuff to have the binaries and header installed automatically when referenced.<br>
The latter reason led me to experiment with ExternalProject.<br>
<br>
David<br><br><div class="gmail_quote">Le 26 janvier 2017 16:05:47 GMT+00:00, Michael Ellery <mellery451@gmail.com> a écrit :<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail"><br /><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"> On Jan 26, 2017, at 1:23 AM, David Jobet <david.jobet@free.fr> wrote:<br /> <br /> Hello,<br /> <br /> suppose I want to use protobuf and integrate it in my project with externalproject_add. (actually, I just have precompiled binaries and libs + header files, I don't have the full sources)<br /> Once the project has been 'built' (actually, installed by a custom rpm-like tool to a shared path), I can use the protoc compiler to generate protobuf c++ files (.pb.h and .pb.cpp files) from a .proto description file.<br /> I can add_dependencies so that the external project is built before projects depending on libprotobuf.a.<br /> <br /> However, I don't know how to do the same thing with .pb.h and .pb.cpp files which use a .proto file and the protoc compiler.<br /> <br /> make is fine with it, but ninja complains with an error like this :<br /> ninja: error: '/path_to_external_projects/protobuf/<a href="http://2.6.0.4/bin/protoc">2.6.0.4/bin/protoc</a>', needed by 'some_project/SomeFile.pb.h', missing and no known rule to make it<br /> <br /> how can I tell ninja that protoc is going to be provided by externalproject ?<br /> If I use byproducts, ninja is happy, but "ninja clean" deletes /path_to_external_projects/protobuf/<a href="http://2.6.0.4/bin/protoc">2.6.0.4/bin/protoc</a>.<br /> I don't want that to happen since /path_to_external_projects/protobuf/<a href="http://2.6.0.4/bin/protoc">2.6.0.4/bin/protoc</a> is shared with other users.<br /> <br /></blockquote><br />I’ve never used protobufs as an external project (I’ve always just done a one-time setup/install)…but is there a reason you can’t just use the standard finder to locate it?  <a href="https://github.com/Kitware/CMake/blob/master/Modules/FindProtobuf.cmake">https://github.com/Kitware/CMake/blob/master/Modules/FindProtobuf.cmake</a><br /><br />-Mike<br /><br /></pre></blockquote></div><br>
-- <br>
Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.</body></html>