Sorry, I got lost in the course of the discussion. I was referring to $<CONFIGURATION>. 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"><<a href="mailto:david.cole@kitware.com" target="_blank">david.cole@kitware.com</a>></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 "in.txt" file). I'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 "${CMAKE_CURRENT_SOURCE_DIR}/in.txt")<br>
set(out "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/out.txt")<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 <<a href="mailto:petr.kmoch@gmail.com">petr.kmoch@gmail.com</a>> wrote:<br>
> Yes, there is a limitation. You can't use them in OUTPUT. See<br>
> <a href="http://public.kitware.com/Bug/view.php?id=12877" target="_blank">http://public.kitware.com/Bug/view.php?id=12877</a><br>
><br>
> Petr<br>
><br>
><br>
> On Wed, Nov 7, 2012 at 12:26 AM, Robert Dailey <<a href="mailto:rcdailey.lists@gmail.com">rcdailey.lists@gmail.com</a>><br>
> wrote:<br>
>><br>
>> I was specifying that in my path for one of the OUTPUT files in<br>
>> add_custom_command(). Is there any limitation on where/how it can be<br>
>> used in a custom command?<br>
>><br>
>> On Tue, Nov 6, 2012 at 2:41 PM, David Cole <<a href="mailto:david.cole@kitware.com">david.cole@kitware.com</a>> wrote:<br>
>> > The multi-configuration generators do understand CMAKE_CFG_INTDIR.<br>
>> ><br>
>> > CMake generates code to call your custom command, including $(OutDir)<br>
>> > wherever you reference ${CMAKE_CFG_INTDIR}, and then Visual Studio<br>
>> > sets that before invoking your command so that it gets resolved to the<br>
>> > correct configuration-specific string.<br>
>> ><br>
>> > Are you seeing your command called with the literal $(OutDir) from<br>
>> > Visual Studio? It should already be substituted for you by the time<br>
>> > you see it in your command's argument parsing.<br>
>> ><br>
>> ><br>
>> ><br>
>> > On Tue, Nov 6, 2012 at 3:31 PM, Robert Dailey <<a href="mailto:rcdailey.lists@gmail.com">rcdailey.lists@gmail.com</a>><br>
>> > wrote:<br>
>> >> On second thought, CMAKE_CFG_INTDIR won't work for multi-configuration<br>
>> >> generators. It is using $(OutDir) for Visual Studio 2008 generator,<br>
>> >> which my custom command can't understand. I'd like to use<br>
>> >> $<CONFIGURATION> but then it won't work for single-configuration<br>
>> >> generators (like NMake) where I want it to be "." only.<br>
>> >><br>
>> >> Any ideas?<br>
>> >><br>
>> >> On Mon, Nov 5, 2012 at 5:45 PM, Robert Dailey<br>
>> >> <<a href="mailto:rcdailey.lists@gmail.com">rcdailey.lists@gmail.com</a>> wrote:<br>
>> >>> Sorry I got confused, what I needed to use is CMAKE_CFG_INTDIR.<br>
>> >>><br>
>> >>> On Mon, Nov 5, 2012 at 5:17 PM, Robert Dailey<br>
>> >>> <<a href="mailto:rcdailey.lists@gmail.com">rcdailey.lists@gmail.com</a>> wrote:<br>
>> >>>> I'm using a custom target to copy files to the following directory:<br>
>> >>>><br>
>> >>>> ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$<CONFIGURATION><br>
>> >>>><br>
>> >>>> This works on Visual Studio generators, because binaries that are<br>
>> >>>> compiled are placed in the directory above.<br>
>> >>>><br>
>> >>>> However, if I generate for NMake on Windows, binaries are placed in<br>
>> >>>> ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} instead, but $<CONFIGURATION> for<br>
>> >>>> the NMake makefiles generator says "Debug" instead of just "." so my<br>
>> >>>> files do not copy to the correct location.<br>
>> >>>><br>
>> >>>> Can anyone explain this? Am I doing something wrong? How can I make<br>
>> >>>> my<br>
>> >>>> files copy to the appropriate binary output directory on both<br>
>> >>>> generators?<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<br>
>> >> <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:<br>
>> >> <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>
>> --<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<br>
>> <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:<br>
>> <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>
><br>
><br>
</div></div></blockquote></div><br>