Sorry, I got lost in the course of the discussion. I was referring to $&lt;CONFIGURATION&gt;. Thanks for the correction.<br><br>Petr<br><br><div class="gmail_quote">On Wed, Nov 7, 2012 at 12:52 PM, David Cole <span dir="ltr">&lt;<a href="mailto:david.cole@kitware.com" target="_blank">david.cole@kitware.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Peter K: ${CMAKE_CFG_INTDIR} is NOT a generator expression, and it<br>
does work in the output clause of add_custom_command.<br>
<br>
Robert:<br>
Yes, you can use ${CMAKE_CFG_INTDIR} in the OUTPUT clause.<br>
<br>
The following CMakeLists works for me with the Xcode generator this<br>
morning (assuming you also have an &quot;in.txt&quot; file). I&#39;m confident it<br>
works with Visual Studio generators as well:<br>
<br>
  cmake_minimum_required(VERSION 2.8)<br>
  project(test_acc)<br>
<br>
  set(in &quot;${CMAKE_CURRENT_SOURCE_DIR}/in.txt&quot;)<br>
  set(out &quot;${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/out.txt&quot;)<br>
<br>
  add_custom_command(<br>
    OUTPUT ${out}<br>
    COMMAND ${CMAKE_COMMAND} -E copy ${in} ${out}<br>
    DEPENDS ${in}<br>
    )<br>
<br>
  add_custom_target(copyInput ALL<br>
    DEPENDS ${out}<br>
    )<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
On Wed, Nov 7, 2012 at 2:53 AM, Petr Kmoch &lt;<a href="mailto:petr.kmoch@gmail.com">petr.kmoch@gmail.com</a>&gt; wrote:<br>
&gt; Yes, there is a limitation. You can&#39;t use them in OUTPUT. See<br>
&gt; <a href="http://public.kitware.com/Bug/view.php?id=12877" target="_blank">http://public.kitware.com/Bug/view.php?id=12877</a><br>
&gt;<br>
&gt; Petr<br>
&gt;<br>
&gt;<br>
&gt; On Wed, Nov 7, 2012 at 12:26 AM, Robert Dailey &lt;<a href="mailto:rcdailey.lists@gmail.com">rcdailey.lists@gmail.com</a>&gt;<br>
&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; I was specifying that in my path for one of the OUTPUT files in<br>
&gt;&gt; add_custom_command(). Is there any limitation on where/how it can be<br>
&gt;&gt; used in a custom command?<br>
&gt;&gt;<br>
&gt;&gt; On Tue, Nov 6, 2012 at 2:41 PM, David Cole &lt;<a href="mailto:david.cole@kitware.com">david.cole@kitware.com</a>&gt; wrote:<br>
&gt;&gt; &gt; The multi-configuration generators do understand CMAKE_CFG_INTDIR.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; CMake generates code to call your custom command, including $(OutDir)<br>
&gt;&gt; &gt; wherever you reference ${CMAKE_CFG_INTDIR}, and then Visual Studio<br>
&gt;&gt; &gt; sets that before invoking your command so that it gets resolved to the<br>
&gt;&gt; &gt; correct configuration-specific string.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Are you seeing your command called with the literal $(OutDir) from<br>
&gt;&gt; &gt; Visual Studio? It should already be substituted for you by the time<br>
&gt;&gt; &gt; you see it in your command&#39;s argument parsing.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; On Tue, Nov 6, 2012 at 3:31 PM, Robert Dailey &lt;<a href="mailto:rcdailey.lists@gmail.com">rcdailey.lists@gmail.com</a>&gt;<br>
&gt;&gt; &gt; wrote:<br>
&gt;&gt; &gt;&gt; On second thought, CMAKE_CFG_INTDIR won&#39;t work for multi-configuration<br>
&gt;&gt; &gt;&gt; generators. It is using $(OutDir) for Visual Studio 2008 generator,<br>
&gt;&gt; &gt;&gt; which my custom command can&#39;t understand. I&#39;d like to use<br>
&gt;&gt; &gt;&gt; $&lt;CONFIGURATION&gt; but then it won&#39;t work for single-configuration<br>
&gt;&gt; &gt;&gt; generators (like NMake) where I want it to be &quot;.&quot; only.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Any ideas?<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; On Mon, Nov 5, 2012 at 5:45 PM, Robert Dailey<br>
&gt;&gt; &gt;&gt; &lt;<a href="mailto:rcdailey.lists@gmail.com">rcdailey.lists@gmail.com</a>&gt; wrote:<br>
&gt;&gt; &gt;&gt;&gt; Sorry I got confused, what I needed to use is CMAKE_CFG_INTDIR.<br>
&gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt;&gt; On Mon, Nov 5, 2012 at 5:17 PM, Robert Dailey<br>
&gt;&gt; &gt;&gt;&gt; &lt;<a href="mailto:rcdailey.lists@gmail.com">rcdailey.lists@gmail.com</a>&gt; wrote:<br>
&gt;&gt; &gt;&gt;&gt;&gt; I&#39;m using a custom target to copy files to the following directory:<br>
&gt;&gt; &gt;&gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt;&gt;&gt; ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$&lt;CONFIGURATION&gt;<br>
&gt;&gt; &gt;&gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt;&gt;&gt; This works on Visual Studio generators, because binaries that are<br>
&gt;&gt; &gt;&gt;&gt;&gt; compiled are placed in the directory above.<br>
&gt;&gt; &gt;&gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt;&gt;&gt; However, if I generate for NMake on Windows, binaries are placed in<br>
&gt;&gt; &gt;&gt;&gt;&gt; ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} instead, but $&lt;CONFIGURATION&gt; for<br>
&gt;&gt; &gt;&gt;&gt;&gt; the NMake makefiles generator says &quot;Debug&quot; instead of just &quot;.&quot; so my<br>
&gt;&gt; &gt;&gt;&gt;&gt; files do not copy to the correct location.<br>
&gt;&gt; &gt;&gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt;&gt;&gt; Can anyone explain this? Am I doing something wrong? How can I make<br>
&gt;&gt; &gt;&gt;&gt;&gt; my<br>
&gt;&gt; &gt;&gt;&gt;&gt; files copy to the appropriate binary output directory on both<br>
&gt;&gt; &gt;&gt;&gt;&gt; generators?<br>
&gt;&gt; &gt;&gt; --<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Visit other Kitware open-source projects at<br>
&gt;&gt; &gt;&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Please keep messages on-topic and check the CMake FAQ at:<br>
&gt;&gt; &gt;&gt; <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Follow this link to subscribe/unsubscribe:<br>
&gt;&gt; &gt;&gt; <a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
&gt;&gt; --<br>
&gt;&gt;<br>
&gt;&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;&gt;<br>
&gt;&gt; Visit other Kitware open-source projects at<br>
&gt;&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;&gt;<br>
&gt;&gt; Please keep messages on-topic and check the CMake FAQ at:<br>
&gt;&gt; <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
&gt;&gt;<br>
&gt;&gt; Follow this link to subscribe/unsubscribe:<br>
&gt;&gt; <a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
&gt;<br>
&gt;<br>
</div></div></blockquote></div><br>