<html><head></head><body bgcolor="#FFFFFF"><div>Is there no way to depend on an other custom command without using extra files?<br><br>It would be nice if i can pass OUTPUT and TARGET to ADD_CUSTOM_COMMAND.</div><div><br></div><div>So i here is my problem in a more detail:</div><div>I want to get a list of files from ${CMAKE_RUNTIME_OUTPUT_DIR}/${PROJECT_NAME}.app where all files beginning with ${PROJECT_NAME} would be excluded.</div><div>After that I want to iterate over that list (foreach) and run ADD_CUSTOM_COMMAND for each file.</div><div><br></div><div>I see here no need for any extra files.</div><div><br></div><div>Thanks in advance</div><div><br></div><div>Best Regards</div><div>NoRulez<br><br>Am 17.02.2012 um 13:47 schrieb Eric Noulard <<a href="mailto:eric.noulard@gmail.com">eric.noulard@gmail.com</a>>:<br><br></div><div></div><blockquote type="cite"><div><br><br>2012/2/17 NoRulez <<a href="mailto:norulez@me.com">norulez@me.com</a>>:<br>> Hi,<br>><br>> i have several ADD_CUSTOM_COMMAND commands with a specified target (let's<br>> say TARGET1).<br>> Between those commands I need to collect files and want to use those<br>
> collected files in the next ADD_CUSTOM_COMMAND.<br>> How can i do that, because the following doesn't work as expected.<br>><br>> ADD_CUSTOM_COMMAND(TARGET TARGET1<br>> COMMAND SAMPLE_COMMAND ARGS ARGUMENTS<br>
> WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}<br>> COMMENT "Doing some stuff"<br>> VERBATIM)<br><br>may be you could do:<br><br>ADD_CUSTOM_COMMAND(TARGET TARGET1<br>
COMMAND SAMPLE_COMMAND ARGS ARGUMENTS<br> COMMAND ${CMAKE_COMMAND} -DOutFile=fl.cmake -P collectFiles.cmake<br> COMMAND ${CMAKE_COMMAND} -DInFile=fl.cmake -P doPostProcessing.cmake<br>
WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}<br> COMMENT "Doing some stuff"<br> VERBATIM)<br><br>the "collectFiles" step will do whatever you want and create the fl.cmake file<br>
which will be loaded by the second "doPostProcessing" in order to get <br>access to list of file in a pre-defined CMake var.<br><br>You can split this in separate add_custom_command but I don't see the need<br>
in your example.<br><br><br>> # HERE I NEED A CUSTOM COMMAND where the CUSTOM_FILES variable can be used<br>> in the next ADD_CUSTOM_COMMAND<br>> ADD_CUSTOM_COMMAND(OUTPUT CUSTOM_FILES<br>> COMMAND /usr/bin/find ARGS ${CUSTOM_PATH} -type f<br>
> COMMENT "Find files"<br>> VERBATIM)<br>><br>> ADD_CUSTOM_COMMAND(TARGET TARGET1<br>> COMMAND SAMPLE_COMMAND ARGS ${CUSTOM_FILES}<br>> WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}<br>
> COMMENT "Doing some stuff"<br>> VERBATIM)<br>><br>> ADD_CUSTOM_COMMAND(TARGET TARGET1<br>> COMMAND SAMPLE_COMMAND ARGS ARGUMENTS<br>> WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}<br>
> COMMENT "Doing some stuff"<br>> VERBATIM)<br>><br>> Thanks in advance<br>><br>> Best Regards<br>> NoRuleu<br>><br>> --<br>><br>> Powered by <a href="http://www.kitware.com">www.kitware.com</a><br>
><br>> Visit other Kitware open-source projects at<br>> <a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><br>><br>> Please keep messages on-topic and check the CMake FAQ at:<br>
> <a href="http://www.cmake.org/Wiki/CMake_FAQ">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">http://www.cmake.org/mailman/listinfo/cmake</a><br>
<br><br><br>-- <br>Erk<br>Membre de l'April - « promouvoir et défendre le logiciel libre » - <a href="http://www.april.org">http://www.april.org</a><br><br>
</div></blockquote></body></html>