[CMake] Nmake and VC IDE output library in different folder

Sergei Nikulov sergey.nikulov at gmail.com
Wed Aug 7 05:54:58 EDT 2013


2013/8/7 Wang Qi <wqking at outlook.com>

> Oh, I just found CMAKE_GENERATOR. I will use it to detect if it's nmake.
> But I would like to know if there is more decent way for the issue.
>
> ----------------------------------------
> > From: wqking at outlook.com
> > To: cmake at cmake.org
> > Date: Wed, 7 Aug 2013 08:03:38 +0000
> > Subject: [CMake] Nmake and VC IDE output library in different folder
> >
> > I use CMake to build a C++ library, which can be built by GCC and VC.
> > I set the output folder to, e.g, lib.
> > If I run CMake with "nmake" generator, both the debug and release
> > binary library are put to folder "lib".
> > However, if I run CMake with, e.g, "Visual Studio 12", to generate
> > the VC solution. Then I build the solution in VC IDE, the debug version
> > library is put to folder "lib/Debug", and the release version is in
> > "lib/Release".
> >
> > My question is, how to make both the generator, "nmake"
> > and "Visual Studio 12", to generate the binary to the same folder?
> > Or to say, can I know current generator name in CMakeLists.txt?
> > I use CMake 2.8.
> >
> > Thanks
> > --
> >
>

Play with variable CMAKE_CFG_INTDIR
For more information http://www.cmake.org/Wiki/CMake_Useful_Variables

HTH

-- 
Best Regards,
Sergei Nikulov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20130807/db8f7cc0/attachment.htm>


More information about the CMake mailing list