<div dir="ltr">2013/8/7 Wang Qi <span dir="ltr"><<a href="mailto:wqking@outlook.com" target="_blank">wqking@outlook.com</a>></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's nmake.<br>
But I would like to know if there is more decent way for the issue.<br>
<br>
----------------------------------------<br>
> From: <a href="mailto:wqking@outlook.com">wqking@outlook.com</a><br>
> To: <a href="mailto:cmake@cmake.org">cmake@cmake.org</a><br>
> Date: Wed, 7 Aug 2013 08:03:38 +0000<br>
> Subject: [CMake] Nmake and VC IDE output library in different folder<br>
<div class=""><div class="h5">><br>
> I use CMake to build a C++ library, which can be built by GCC and VC.<br>
> I set the output folder to, e.g, lib.<br>
> If I run CMake with "nmake" generator, both the debug and release<br>
> binary library are put to folder "lib".<br>
> However, if I run CMake with, e.g, "Visual Studio 12", to generate<br>
> the VC solution. Then I build the solution in VC IDE, the debug version<br>
> library is put to folder "lib/Debug", and the release version is in<br>
> "lib/Release".<br>
><br>
> My question is, how to make both the generator, "nmake"<br>
> and "Visual Studio 12", to generate the binary to the same folder?<br>
> Or to say, can I know current generator name in CMakeLists.txt?<br>
> I use CMake 2.8.<br>
><br>
> Thanks<br>
> --<br>
><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>