<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hi All,<div><br></div><div>I'm really struggling to use ExternalProject_Add() in our CMake project.</div><div><br></div><div>Based on the documentation, I was expecting the simplest Git-based external project with all defaults to act just like using a Git submodule locked at a specific commit. </div><div><pre style="overflow:auto hidden;padding:5px;background-color:rgb(238,238,238);color:rgb(51,51,51);line-height:15.6px;border-top:1px solid rgb(170,204,153);border-bottom:1px solid rgb(170,204,153);border-left:none;border-right:none"><span class="gmail-nf" style="color:rgb(0,112,32)">include(</span><span class="gmail-nb">ExternalProject</span><span class="gmail-nf" style="color:rgb(0,112,32)">)</span><span class="gmail-w" style="color:rgb(187,187,187)"></span>
<span class="gmail-nf" style="color:rgb(0,112,32)">ExternalProject_Add(</span><span class="gmail-nb">foobar</span><span class="gmail-w" style="color:rgb(187,187,187)"></span>
<span class="gmail-w" style="color:rgb(187,187,187)"> </span><span class="gmail-no" style="color:rgb(64,112,160)">GIT_REPOSITORY</span><span class="gmail-w" style="color:rgb(187,187,187)"> </span><span class="gmail-na" style="color:rgb(144,96,96)">git@github.com:FooCo/FooBar.git</span><span class="gmail-w" style="color:rgb(187,187,187)"></span>
<span class="gmail-w" style="color:rgb(187,187,187)"> </span><span class="gmail-no" style="color:rgb(64,112,160)">GIT_TAG</span><span class="gmail-w" style="color:rgb(187,187,187)"> </span><span class="gmail-na" style="color:rgb(144,96,96)">origin/release/1.2.3</span><span class="gmail-w" style="color:rgb(187,187,187)"></span>
<span class="gmail-nf" style="color:rgb(0,112,32)">)</span></pre></div><div>The documentation states "The default configure command runs CMake with options based on the main project.", so I was expecting any options we pass to the owning project such as CMAKE_INSTALL_PREFIX and other variables would get propagated to the ExternalProject. However, that doesn't seem to be the case. Do I need to explicitly apply every variable through the "CMAKE_ARGS" options? If so, </div><div><br></div><div>Also, unless I specify a custom CONFIGURE_COMMAND, I can't figure out how to make the configure step happen during the parent projects configure step. Should that be happening? If not, is there a simple way to force it to happen without having to duplicate everything the default options do? I'm seeing mixed results with online resources, along with many older examples that just don't work anymore.</div><div><br></div><div>Thanks!</div><div><br></div></div></div></div></div>