[CMake] Using cmake under windows

Brad King brad.king at kitware.com
Mon Aug 28 11:19:20 EDT 2006


Yann Renard wrote:
> Brad King wrote:
>> You need to run CMake from the same command prompt in which the
>> environment is set.  From that same command prompt try:
>>
>> mkdir myproj-build
>> cd myproj-build
>> cmake c:/path/to/myproj -G"NMake Makefiles"
>>
>> Make sure you have a clean source tree in c:/path/to/myproj that does
>> not contain any attempt to build the project in-source.
> That is very close to what I did, however, this seems to work better.
> The reason why this is working better is the option you add '-G"NMake
> Makefiles"'.

You may also run CMakeSetup from the same command prompt and then select
NMake Makefiles from the dialog that asks you the first time you
configure the project in an empty build tree.

> Thus, I should be able to generate nmake makefiles, but no VC8
> projects, right ?

If you follow the instructions from my other response (the reference to
http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk) then you
should be able to do VC8 projects too.  Since the IDE has its own
environment it is safe to start CMakeSetup from the start menu.

You may have been getting confused by trying both NMake Makefiles and
Visual Studio 8 generators in the same build tree.  Whichever you
selected the first time was actually used from then on no matter how you
started CMake or what options you gave.

-Brad


More information about the CMake mailing list