[CMake] Can't generate Release build in Visual Studio 9

Kris Thielemans kris at asc.uk.com
Fri Feb 24 12:58:16 EST 2012


Hi Mauricio

The SLN solution contains all possible build-types. The user just have to
select which one they want (i.e. in Visual Studio, not cmake)

Kris

> -----Original Message-----
> From: cmake-bounces at cmake.org [mailto:cmake-bounces at cmake.org] On
> Behalf Of Mauricio Klein
> Sent: 24 February 2012 17:40
> To: cmake at cmake.org
> Subject: [CMake] Can't generate Release build in Visual Studio 9
> 
> Hello fellows!
> 
> I'm using CMake to compile and CPack to pack my codes.
> 
> The Linux version is working very well. But now i'm porting the
> CMakeLists.txt to Windows and i'm having some problems:
> 
> My main problem is: how can i set the build type in Visual Studio to
"Release"
> instead "Debug"?
> 
> I've already tried set CMAKE_BUILD_TYPE:
> set(CMAKE_BUILD_TYPE "Release")
> 
> ... and CMAKE_CONFIGURATION_TYPES:
> set(CMAKE_CONFIGURATION_TYPES "Release")
> 
> But every time i open the SLN file generated by Cmake and run "Build" from
> inside the Visual Studio, the binary is always generated in Debug mode.
> 
> Is there a way to set VS configuration to generate Release build using
CMake
> variables?
> 
> PS: I'm running cmake from dos (command line) and, after, i open the sln
file
> with Visual Studio. Hope this is the right way to do that.
> 
> Thanks in advance for your attention?
> 
> 
> --
> Best regards,
> 
> Maurício Souza Klein.




More information about the CMake mailing list