[CMake] win32 and x64 in the same generator?

Tyler Roscoe tyler at cryptio.net
Mon Jun 1 18:29:33 EDT 2009


Our developers are used to a single .vcproj that knows how to build both
32-bit and 64-bit versions of libraries. Under CMake, 32-bit and 64-bit
are considered separate platforms with separate generators and requiring
separate binary directories.

Conceptually and as a build engineer, this makes more sense to me.
Pragmatically and as a developer, it just means extra hoops to jump
through.

This topic has been discussed in passing on the list: 

http://www.cmake.org/pipermail/cmake/2007-February/012982.html
http://www.cmake.org/pipermail/cmake/2007-September/016630.html

To answer Bill's question from that first link, I don't think CMake
would need to do anything special. Users need to have the PlatformSDK
for 64-bit installed (or something like that), but it looks like the
.vcproj just has an extra Platform:

        <Platforms>
                <Platform
                        Name="Win32"
                />
                <Platform
                        Name="x64"
                />
        </Platforms>

and then some extra Configurations:

        <Configurations>
                <Configuration
                        Name="Debug|Win32"
                        OutputDirectory="$(SolutionDir)$(ConfigurationName)"
                        ...
                </Configuration>
                <Configuration
                        Name="Debug|x64"
                        OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
                        ...
                </Configuration>


What are the pitfalls or difficulties in supporting this sort of
"cross-compiling" in Visual Studio?

Thanks,
tyler


More information about the CMake mailing list