<div dir="ltr">I am attempting to use ExternalDependencies_Add with the last Protobuf version (v3.0.0) which is in alpha3 (I'm using the master branch actually)[1].<div>If you don't already know: contrary to previous Protobuf version, v3.x provides</div><div>cmake scripts (and also makes CMake's FindProtobuf module unusuable if you build Protobuf using CMake BTW).</div><div><br></div><div>I am having trouble figuring out how to ExternalProject_add work in this case:</div><div>the CMakeFiles.txt is not in the root directory of Protobuf sources, it is in ./cmake/ [2]</div><div>So at build time, after download, I obviously get:</div><div><br></div><div>>CUSTOMBUILD : CMake error : The source directory "blahblah/install_protobuf" does not appear to contain CMakeLists.txt.<br></div><div><br></div><div>I tried several approaches using this as a base:</div><div><div><br></div><div><div>ExternalProject_Add( install_protobuf</div><div>    PREFIX ${NETRUSH_DEPENDENCIES_DIR}/protobuf</div><div>    GIT_REPOSITORY <a href="https://github.com/google/protobuf.git">https://github.com/google/protobuf.git</a></div><div>    GIT_TAG master</div><div>   </div><div>    CMAKE_CACHE_ARGS</div><div>        -DBUILD_TESTING:bool=FALSE</div><div>)</div></div><div><br></div><div><br></div></div><div>I tried setting SOURCE_DIR but failed to make it work mainly because I'm</div><div>not sure what value to set exactly, and </div><div><br></div><div>   SOURCE_DIR cmake</div><div><br></div><div>Does not seem to work.</div><div><br></div><div>I was wondering if there is some args I could pass to CMake using CMAKE_ARGS</div><div>but from the cmake[3] page in the doc I don't see anything that match exactly, or </div><div>I might be misunderstanding something.</div><div><br></div><div>I found this recommandation from Miklos Espak from 8th February 2015:</div><div>"Specify a patch command that creates a toplevel cmake list with one 'add_subdirectory(A)'  line."</div><div><br></div><div>It seems to work, but it also means that the repository is modified, which is something</div><div>I want to avoid. Also it's really a hack for passing the right working directory to cmake.</div><div><br></div><div>Is there a simpler way to do it that I missed?</div><div><br></div><div>Thanks for your time.</div><div><br></div><div>Joël Lamotte</div><div><br></div><div><br></div><div>[1] <a href="https://github.com/google/protobuf">https://github.com/google/protobuf</a></div><div>[2] <a href="https://github.com/google/protobuf/tree/master/cmake">https://github.com/google/protobuf/tree/master/cmake</a></div><div>[3] <a href="http://www.cmake.org/cmake/help/v3.3/manual/cmake.1.html#manual:cmake(1)">http://www.cmake.org/cmake/help/v3.3/manual/cmake.1.html#manual:cmake(1)</a></div></div>