<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">I am trying to figure out the best way to set up CMake to do release builds with profile guided optimization for gcc and msvc.<br><br>The general sequence I want to perform is...<br><br>1. Build with instrumentation.<br>2. Run training apps.<br>3. rebuild with pgo. (In gcc this is a clobber build, and in msvc it is just a relink).<br><br>My best guess is that I want to do the build, configure ctest to run my training apps, and then redo the build. Well 1 and 2 is easy, but I am trying to figure out how to arrange for 3 to be fired off without manual intervention. I am sure there is an easy way to do it, but I am brain farting on it right now.<br><br>I have used scons to do this sort of thing before, but I can't figure out how to make it work with cmake. <br><br><br><br><br><br></td></tr></table><br>