<br><br>2012/2/17 NoRulez &lt;<a href="mailto:norulez@me.com">norulez@me.com</a>&gt;:<br>&gt; Hi,<br>&gt;<br>&gt; i have several ADD_CUSTOM_COMMAND commands with a specified target (let&#39;s<br>&gt; say TARGET1).<br>&gt; Between those commands I need to collect files and want to use those<br>
&gt; collected files in the next ADD_CUSTOM_COMMAND.<br>&gt; How can i do that, because the following doesn&#39;t work as expected.<br>&gt;<br>&gt; ADD_CUSTOM_COMMAND(TARGET TARGET1<br>&gt;                    COMMAND SAMPLE_COMMAND ARGS ARGUMENTS<br>
&gt;                    WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}<br>&gt;                    COMMENT &quot;Doing some stuff&quot;<br>&gt;                    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 &quot;Doing some stuff&quot;<br>                   VERBATIM)<br><br>the &quot;collectFiles&quot; step will do whatever you want and create the fl.cmake file<br>
which will be loaded by the second &quot;doPostProcessing&quot; 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&#39;t see the need<br>
in your example.<br><br><br>&gt; # HERE I NEED A CUSTOM COMMAND where the CUSTOM_FILES variable can be used<br>&gt; in the next ADD_CUSTOM_COMMAND<br>&gt; ADD_CUSTOM_COMMAND(OUTPUT CUSTOM_FILES<br>&gt;                    COMMAND /usr/bin/find ARGS ${CUSTOM_PATH} -type f<br>
&gt;                    COMMENT &quot;Find files&quot;<br>&gt;                    VERBATIM)<br>&gt;<br>&gt; ADD_CUSTOM_COMMAND(TARGET TARGET1<br>&gt;                    COMMAND SAMPLE_COMMAND ARGS ${CUSTOM_FILES}<br>&gt;                    WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}<br>
&gt;                    COMMENT &quot;Doing some stuff&quot;<br>&gt;                    VERBATIM)<br>&gt;<br>&gt; ADD_CUSTOM_COMMAND(TARGET TARGET1<br>&gt;                    COMMAND SAMPLE_COMMAND ARGS ARGUMENTS<br>&gt;                    WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}<br>
&gt;                    COMMENT &quot;Doing some stuff&quot;<br>&gt;                    VERBATIM)<br>&gt;<br>&gt; Thanks in advance<br>&gt;<br>&gt; Best Regards<br>&gt; NoRuleu<br>&gt;<br>&gt; --<br>&gt;<br>&gt; Powered by <a href="http://www.kitware.com">www.kitware.com</a><br>
&gt;<br>&gt; Visit other Kitware open-source projects at<br>&gt; <a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><br>&gt;<br>&gt; Please keep messages on-topic and check the CMake FAQ at:<br>
&gt; <a href="http://www.cmake.org/Wiki/CMake_FAQ">http://www.cmake.org/Wiki/CMake_FAQ</a><br>&gt;<br>&gt; Follow this link to subscribe/unsubscribe:<br>&gt; <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&#39;April - « promouvoir et défendre le logiciel libre » - <a href="http://www.april.org">http://www.april.org</a><br><br>