<div dir="ltr">You'll also want to build your own project with ExternalProject, and use the DEPENDS option to control build order. This ensures that all dependencies are fully installed before your own project is even configured. The project with all the ExternalProject calls is typically called a superbuild, and effectively becomes an optional convenience to building your own project.</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 26, 2017 at 3:23 AM, David Jobet <span dir="ltr"><<a href="mailto:david.jobet@free.fr" target="_blank">david.jobet@free.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">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/<wbr>protobuf/<a href="http://2.6.0.4/bin/protoc" rel="noreferrer" target="_blank">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/<wbr>protobuf/<a href="http://2.6.0.4/bin/protoc" rel="noreferrer" target="_blank">2.6.0.4/bin/protoc</a>.<br>
I don't want that to happen since /path_to_external_projects/<wbr>protobuf/<a href="http://2.6.0.4/bin/protoc" rel="noreferrer" target="_blank">2.6.0.4/bin/protoc</a> is shared with other users.<br>
<br>
With regards<br>
<br>
David<br>
--<br>
<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" rel="noreferrer" target="_blank">http://www.cmake.org/Wiki/<wbr>CMake_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/<wbr>support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/<wbr>consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/<wbr>training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/cmake" rel="noreferrer" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/cmake</a><br>
</blockquote></div><br></div>