[CMake] Visual Studio: build a 32 bit application under windows 64 bits

ycollette.nospam at free.fr ycollette.nospam at free.fr
Fri Nov 4 08:32:21 EDT 2011


No, that's not what I am looking for.
Inside the CMakeLists.txt, I want to tell to the visual studio C compiler to compile an executable into 32 bit applications.
The cmake exe has been launched into the 64 bit visual console.

Best regards,

YC

----- Mail Original -----
De: "Mourad Boufarguine" <mourad at boufarguine.name>
À: "ycollette nospam" <ycollette.nospam at free.fr>
Cc: "cmake" <cmake at cmake.org>
Envoyé: Vendredi 4 Novembre 2011 13h24:43 GMT +01:00 Amsterdam / Berlin / Berne / Rome / Stockholm / Vienne
Objet: Re: [CMake] Visual Studio: build a 32 bit application under windows 64 bits

On Fri, Nov 4, 2011 at 8:37 AM,  <ycollette.nospam at free.fr> wrote:
> Hello,
>
> I've got a big project using cmake.
> Several applications are build as native 64 bits applications, but I need to build one application as a 32 bit application.
> cmake is run from the Visual Studio 64 console.
>
> Is it possible to force a 32 compilation using cmake ?
>
> Best regards,
>
> YC
> --
>

Hi,

You are looking for the -G switch. exemple for VS 2010 :

cmake -G"Visual Studio 10" => 32bit
cmake -G"Visual Studio 10 Win64" => 64bit

Look into cmake documentation for the generator names of other VS versions.

Cheers,
Mourad


More information about the CMake mailing list