<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>