1
votes

The VS environment variable is set beforehand with vcvars32.bat, and VS is the only compiler that I use; the OS is win 7.

The error happens with cmake-gui; specifying the compiler with path results in error 'compiler failed to make simple test'; alternatively, cmake -i from command line succeeds initially with presenting an 'options' menu which then fails to allocate a 'cmakelists.txt' file (which is somewhere deeper in the cmake folder).

Where am I going wrong? (I continued with building the solution files from VS 12, but there's other issues.)

1
Are you run cmake and cmake-gui from "VS2012 Native Tools Command Prompt"? "Programs->Microsoft Visual Studio 2012->Visual Studio Tools"?Sergei Nikulov
@Sergey I started cmake-gui as 'stand-alone', specified file path of source code and target folder for new build, and then for configuration NMAKE makefiles; tried VS 12 (for VS2013, I believe) to see if a compiler is recognised at all. Used VS2010 Command Prompt for setting environment path and trying cmake -iuser2824639
Do not run cmake-gui as standalone. Run it from VS2012 Native Tools Command Prompt. This will help to generate nmake project. Will not work without "vcvars.bat" set.Sergei Nikulov
@Sergey I see, think I'll either look at the CMakeFiles in more detail or probably try continue with the VS project files - many thanks for you helpuser2824639
@Sergey Realised the difference between just starting cmake-gui from short-cut and from command prompt like you said, and re-tried - all good. You're a staruser2824639

1 Answers

1
votes

The answer to your question from cmake mailing list

Run cmake-gui FROM the target environment, just like you run cmake...

i.e. : type "cmake-gui" in the cmd prompt that has your stuff set up in it. Don't just launch it from a short-cut unless you're using the "Visual Studio *" generators. Those do not need any special environment. Many of the makefile ones do.