Hi All,<div><br></div><div>after moving from Visual Studio to Eclipse I realised that PRE_BUILD command does not work as expected.</div><div><br></div><div>According to documentation:</div><div><br></div><div><span class="Apple-style-span" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; line-height: 22px; ">&#39;Note that the PRE_BUILD option is only supported on Visual Studio 7 or later. For all other generators PRE_BUILD will be treated as PRE_LINK.&#39;</span></div>
<div><br></div><div>I was suprised with that, because usually when one use makefile, he can create additional target to perform files copy operations and etc.</div><div><br></div><div>I found old thread in this mail list on same question: <a href="http://www.cmake.org/pipermail/cmake/2007-December/018445.html">http://www.cmake.org/pipermail/cmake/2007-December/018445.html</a></div>
<div><br></div><div>I guess no one had time to take a closer look into this problem</div><div><br></div><div>There is, actually, wery simple workaround using cmake:</div><div><br></div><div><div># Add pre_build target</div>
<div>add_custom_target(SOMETARGET_prebuild DEPENDS SOMEDEPENDANCIES)</div><div>add_dependencies(SOMETARGET SOMETARGET_prebuild)</div><div><br></div><div>add_custom_command(</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>TARGET SOMETARGET_prebuild</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>POST_BUILD</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>COMMAND do some stuff)</div><div><br></div><div>I was just wondering if it could be possible to integrate into add_custom_comman() such sollution for makefiles? It could make cmake code look nicer and make life much easier.</div>
<div><br></div><div>Here are some arguments for it: In example above things look quite simple, but if I want to add a few commands to one project from MACRO (what I actually do)? How should I check wheather SOMETARGET_prebuild (or whatever) already has been created? Defently there some simple precautions to avoid doube add, but I guess it should be nicer to automate it.</div>
<div><br></div><div>In any case, thanks for a great tool!</div><div><br></div><div>Best regards,</div><div><br></div><div>Kirill Kranke</div></div>