<div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div class="h5">Have you looked at add_custom_command(TARGET ...) or add_custom_target(...)?</div>
</div>
Those are how you run can run commands as part of the build, but after some<br>
other targets are compiled.<br>
<br>
Clint<br></blockquote><div><br></div>That works great, thanks for the tip!<div><br></div><div>I build my code, and then my test programs using add_executable.  Then I can do e.g.:</div><div><br><div>add_custom_command(TARGET test_harness POST_BUILD COMMAND test_harness)</div>
<div><br></div><div>and test_harness runs after building, with proper dependencies, and a failing test causes a failing build.  Perfect.  Anything I don&#39;t want to run by default I can leave to add_test on its own.</div>
<div><br></div><div>Thanks very much,</div><div><br></div><div>Gavin</div></div></div></div>