<br><br><div class="gmail_quote">On Thu, Apr 3, 2008 at 10:21 PM, Alexander Neundorf <<a href="mailto:a.neundorf-work@gmx.net">a.neundorf-work@gmx.net</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Thursday 03 April 2008, Mehdi Rabah wrote:<br>
...<br>
<div class="Ih2E3d">> ok then I re-explain : I have a custom rule "sync" that send binaries to a<br>
> embedded computer. To make sure that the binaries that I send are the<br>
> lastest version (ie the source have recompiled since my last modification)<br>
> I wanted to make my "sync" target depend on "all". ie when I type "make<br>
> sync" the project is rebuild before the synchronisation is made. the same<br>
> result can be done by typing "make && make sync" but I want it to be<br>
> managed by cmake because other people in the project doesn't need to know<br>
> that they need to rebuild the project before each sync. They just have to<br>
> know "make sync".<br>
<br>
</div>Ah, ok.<br>
<br>
You can't do this with add_dependencies() or something similar.<br>
Are you using exclusively "make" or also e.g. XCode or Visual Studio ?<br>
(ok, you're cross compiling with makefiles, so XCode and VS don't work...)<br>
<br>
<br>
The following should work (not tested):<br>
<br>
add_custom_target(sync<br>
COMMAND ${CMAKE_BUILD_TOOLS} -C ${CMAKE_CURRENT_BINARY_DIR} all<br>
COMMAND <sync your binary to the target> )<br>
<br>
<br>
Alex</blockquote><div><br>Ok it's a good idea, I'll try this asap, it should work.<br><br>Thanks,<br>--<br>Mehdi<br></div></div><br>