Yes, there is a limitation. You can't use them in OUTPUT. See <a href="http://public.kitware.com/Bug/view.php?id=12877">http://public.kitware.com/Bug/view.php?id=12877</a><br><br>Petr<br><br><div class="gmail_quote">On Wed, Nov 7, 2012 at 12:26 AM, Robert Dailey <span dir="ltr"><<a href="mailto:rcdailey.lists@gmail.com" target="_blank">rcdailey.lists@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">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>
<div class="HOEnZb"><div class="h5"><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>> 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 <<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 <<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 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 <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: <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 <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: <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>
</div></div></blockquote></div><br>