[CMake] Setting Platform (Win32 or x64) for Visual Studio in CMake

John Drescher drescherjm at gmail.com
Wed Oct 26 10:36:52 EDT 2011


On Wed, Oct 26, 2011 at 10:17 AM, Ludovic Hoyet <lhoyet at gmail.com> wrote:
> Just to know, is there a way to set the platform in the CMakeList? At the
> moment if I select VS_XXX if creates uses the Win32 platform, and the x64 is
> used if I select VS_XXX x64. I would like to set a variable to the default
> platform (no pb with that), and let the users modify if if they really want
> (therefore create a Win32 platform from VS_XXX x64 if that's what they want,
> from setting this variable)...
> Thanks
>

You do this by setting the generator. I would not hardwire that in a
CMakeLists.txt file. Instead if you want create a batch file that
calls cmake.exe with the appropriate generator..


More information about the CMake mailing list