<div>Perhaps this is what you're looking for:</div><div><a href="http://www.cmake.org/cmake/help/v2.8.8/cmake.html#command:add_custom_command">http://www.cmake.org/cmake/help/v2.8.8/cmake.html#command:add_custom_command</a></div>
<div><br></div><div>For example, this command copies a set of libraries into a directory:</div><div><div>if(WIN32)</div><div> foreach(ITEM ${DEP_SHARED_LIBRARIES})</div><div> add_custom_command(TARGET mytarget PRE_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${ITEM} . WORKING_DIRECTORY ${PROJECT_BINARY_DIR} COMMENT "Copying ${ITEM} to ${PROJECT_BINARY_DIR}")</div>
<div> endforeach()</div><div>endif()</div></div><div><br></div><div>You could use the PRE_LINK key and what ever your custom command is I expect.</div><div><br></div><div>~</div><div>Doug.</div><br><div class="gmail_quote">
On Thu, Jun 14, 2012 at 4:59 PM, Johannes Bauer <span dir="ltr"><<a href="mailto:dfnsonfsduifb@gmx.de" target="_blank">dfnsonfsduifb@gmx.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Dear list,<br>
<br>
I'd like to know if the following is possible: in my old buildsystem<br>
(that I'm trying to convert to cmake) there is a script which runs just<br>
before the linking stage. It examines the created objects and then<br>
creates a source-file which needs to be linked in. The way this was done<br>
before is something like this (pseudo-Makefile syntax):<br>
<br>
execut: $(OBJS)<br>
./generate_code<br>
gcc $(LDFLAGS) $(OBJS) generated.c -o execut<br>
<br>
.c.o:<br>
gcc -c blah<br>
<br>
<br>
Is it possible to achieve something similar with cmake? I've read the<br>
FAQ about generating code, but I do not know how to control the<br>
dependencies (i.e. at which stage it is executed).<br>
<br>
Best regards,<br>
Johannes<br>
--<br>
<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
</blockquote></div><br>