[CMake] A nice fix for windows cl compilation (to support XBox360 for instance)

Josef Karthauser joe.karthauser at geomerics.com
Thu Oct 11 06:26:05 EDT 2007


Hey there,

I've submitted a patch to the bug tracker, under number 0005865, for
people who generate make/nmake files under Windows with the Microsoft
compiler (cl.exe).  The old behaviour was that the linker (link.exe) was
picked up from the path at compile time.  The new behaviour is that it
is assumed to be in the same location as the compiler.

This means that it is now trivial to compile Xbox360 stuff, for
instance.
Just add this to your CMakeFiles.txt:

	SET(ENV{PATH} "C:/Program Files/Microsoft Xbox 360
SDK/bin/win32/;$ENV{PATH}")

This puts the xbox compiler in the path before the win32 compiler, which
means cmake will find that one.  Then at nmake time it doesn't matter
what is in the path, as with the patch the linker (link.exe) used will
be the correct one (in the same directory as the cl.exe) instead of the
one in the path, which is probably the win32 one.

Joe


More information about the CMake mailing list