<div dir="ltr">2013/8/7 Wang Qi <span dir="ltr">&lt;<a href="mailto:wqking@outlook.com" target="_blank">wqking@outlook.com</a>&gt;</span><br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Oh, I just found CMAKE_GENERATOR. I will use it to detect if it&#39;s nmake.<br>
But I would like to know if there is more decent way for the issue.<br>
<br>
----------------------------------------<br>
&gt; From: <a href="mailto:wqking@outlook.com">wqking@outlook.com</a><br>
&gt; To: <a href="mailto:cmake@cmake.org">cmake@cmake.org</a><br>
&gt; Date: Wed, 7 Aug 2013 08:03:38 +0000<br>
&gt; Subject: [CMake] Nmake and VC IDE output library in different folder<br>
<div class=""><div class="h5">&gt;<br>
&gt; I use CMake to build a C++ library, which can be built by GCC and VC.<br>
&gt; I set the output folder to, e.g, lib.<br>
&gt; If I run CMake with &quot;nmake&quot; generator, both the debug and release<br>
&gt; binary library are put to folder &quot;lib&quot;.<br>
&gt; However, if I run CMake with, e.g, &quot;Visual Studio 12&quot;, to generate<br>
&gt; the VC solution. Then I build the solution in VC IDE, the debug version<br>
&gt; library is put to folder &quot;lib/Debug&quot;, and the release version is in<br>
&gt; &quot;lib/Release&quot;.<br>
&gt;<br>
&gt; My question is, how to make both the generator, &quot;nmake&quot;<br>
&gt; and &quot;Visual Studio 12&quot;, to generate the binary to the same folder?<br>
&gt; Or to say, can I know current generator name in CMakeLists.txt?<br>
&gt; I use CMake 2.8.<br>
&gt;<br>
&gt; Thanks<br>
&gt; --<br>
&gt;<br></div></div></blockquote><div> </div></div>Play with variable CMAKE_CFG_INTDIR </div><div class="gmail_extra">For more information <a href="http://www.cmake.org/Wiki/CMake_Useful_Variables">http://www.cmake.org/Wiki/CMake_Useful_Variables</a></div>
<div class="gmail_extra"><br></div><div class="gmail_extra">HTH<br clear="all"><div><br></div>-- <br>Best Regards,<br>Sergei Nikulov
</div></div>