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

Wang Qi wqking at outlook.com
Wed Aug 7 04:03:38 EDT 2013


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 		 	   		  


More information about the CMake mailing list