<div dir="ltr"><div>Hi everyone,</div><div><br></div>I would like to create a CMake test that does the following:<br> * Download a file from an external resource<br> * Do something with the file<br> * compile an executable myTest<br> * execute myTest outputfile<br><br>Using ExternalData for downloading the file works well, but the second step (file conversion, in this example cp for simplicity) does not work:<div>```</div><div><div>cmake_minimum_required(VERSION 3.2)</div><div><br></div><div>project(mytest)</div><div><br></div><div># Download the files</div><div>INCLUDE(ExternalData)</div><div>set(</div><div>  ExternalData_URL_TEMPLATES</div><div>  "<a href="https://downloads.sourceforge.net/project/noshdata/%(algo)/%(hash)">https://downloads.sourceforge.net/project/noshdata/%(algo)/%(hash)</a>"</div><div>  )</div><div>ExternalData_Expand_Arguments(</div><div>  testFetchData</div><div>  OUT_DATA DATA{${CMAKE_SOURCE_DIR}/test.e}</div><div>  )</div><div>ExternalData_Add_Target(testFetchData)</div><div><br></div><div>add_custom_command(</div><div>  OUTPUT test.g</div><div>  COMMAND cp test.e test.g</div><div>  DEPENDS test.e</div><div>  )</div><div><br></div><div>ADD_EXECUTABLE("myTest" main.cpp)</div><div><br></div><div>add_test(myTest test.g)</div>```<br>I suppose I'm missing something about the dependencies here; after all, the `add_custom_command` has to wait for `testFetchData` to complete. Likewise, `add_test` has to wait for `add_custom_command` to complete.<br><br>Hints appreciated.</div><div><br></div><div>Cheers,</div><div>Nico</div></div>