<div dir="ltr"><div><div><div><div>Hi Braden,<br><br></div>the purpose of CMAKE_CFG_INTDIR is to expand to something that is meaningful to the build system you&#39;re using. It&#39;s a way to transport information from CMake-time (when your CMakeLists are processed) to build-time (when you run a build).<br>

<br></div>The exact value of CMAKE_CFG_INTDIR depends on the generator you&#39;re using. For Visual Studio, for example, it&#39;s $(OutDir) or $(Configuration), depending on VS version. Note that these aren&#39;t CMake variable, they&#39;re Visual Studio macros, which are expanded by VS itself when it sees them in a command-line it&#39;s processing. CMAKE_CFG_INTDIR will have a value with similar properties for other multi-configuration generators (e.g. $(CONFIGURATION) for XCode).<br>

<br></div>On single-config generators, the value is just &quot;.&quot;, because these do not have different paths for different configurations (since they just have one). With such generators, the name of the configuration is available at CMake-time in the variable CMAKE_BUILD_TYPE.<br>

<br></div>On multi-config generators, there is no &quot;current configuration&quot; at CMake-time. When a reference to a configuration-specific path (or something else configuration-specific) is necessary, its dereferencing must be done at build time, and for this purpose, the &quot;meta&quot; variable CMAKE_CFG_INTDIR is used.<br>

<br>I hope this helps you. Regarding your particular question about replacing in the value, are you sure CMAKE_CFG_INTDIR expands to a text with braces, not parentheses?<br><br>Petr<br><div class="gmail_extra"><br><br><div class="gmail_quote">

On Fri, Mar 29, 2013 at 9:58 PM, Braden McDaniel <span dir="ltr">&lt;<a href="mailto:braden@endoframe.com" target="_blank">braden@endoframe.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

The value of the variable CMAKE_CFG_INTDIR is the literal string &quot;${config}&quot;<br>
(that is, CMake does not expand this variable itself). I&#39;d like to expand this<br>
literal variable within CMake using a value I supply; that is, I&#39;d like to<br>
replace the literal string &quot;${config}&quot; with something else; say, &quot;foo&quot;. Alas, I<br>
have not been able to get this to work:<br>
<br>
  string(REPLACE &quot;\${config}&quot; foo MY_OUTPUT_VAR ${CMAKE_CFG_INTDIR})<br>
<br>
Why isn&#39;t this working? Is there some other way to accomplish what I want?<br>
<br>
Braden<br>
<br>
<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>
</blockquote></div><br></div></div>