[CMake] choose 32bit or 64bit in visual studio

Mike Jackson mike.jackson at bluequartz.net
Thu Oct 8 14:39:39 EDT 2009


 Just to elaborate even more (since I went through this in the last month.. )

Basically you need 2 build folders: 1 for i386 and one for x86_64.

You can invoke the CMake-Gui and have it create each folder for you as
you go. As you "configure" each build directory for the first time
select either the " Visual Studio 9 2008" for 32 Bit development or "
Visual Studio 9 2008 - Win64" for 64 bit development.

You will end up with 2 Visual Studio solution files, 1 in each build
directory, for your project.

Hope that clears it all up.
Mike Jackson

PS: The Visual Studio Express 2008 version can NOT do 64 bit compiles.
Your choices are to google for the solution to that (which involves
lots of hacking of the registry) or purchasing at least the "Standard"
version of Visual Studio.


On Thu, Oct 8, 2009 at 10:44 AM, j s <j.s4403 at gmail.com> wrote:
> Hello Bill,
>
> So you are saying that if I have both the 32 bit compiler and 64 bit
> compiler installed on 64 bit windows, I will be able to create both 32 bit
> and 64 bit applications if I use the appropriate Visual Studio generator?
>
> I am not exactly sure what your last statement about not being able to do
> the cross compile thing meant?
>
> Regards,
>
> Juan
>
> On Wed, Oct 7, 2009 at 9:50 PM, Bill Hoffman <bill.hoffman at kitware.com>
> wrote:
>>
>> j s wrote:
>>>
>>> On 64-bit windows with CMAKE, how do you choose whether to use the 32 bit
>>> or 64 bit visual c++ compiler for the visual studio generator? I am thinking
>>> about starting to cross compile both 64 bit and 32 bit version of the
>>> software, but all I have right now is the 32 bit compiler.
>>>
>> They are separate generators:
>>
>> cmake --help
>> ...
>>  Visual Studio 8 2005        = Generates Visual Studio .NET 2005 project
>>                                files.
>>  Visual Studio 8 2005 Win64  = Generates Visual Studio .NET 2005 Win64
>>                                project files.
>>  Visual Studio 9 2008        = Generates Visual Studio 9 2008 project
>> files.
>>  Visual Studio 9 2008 Win64  = Generates Visual Studio 9 2008 Win64
>> project
>>                                files.
>>
>> Currently CMake can not do the cross compile thing on windows with vs
>> projects.
>>
>> -Bill
>>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>


More information about the CMake mailing list