[CMake] Problem with Visual Studio 2010, Windows 7 64bit
Michael Jackson
mike.jackson at bluequartz.net
Wed Nov 28 07:59:20 EST 2012
On Nov 28, 2012, at 7:37 AM, David Doria <daviddoria at gmail.com> wrote:
> On Wed, Nov 28, 2012 at 4:22 AM, Andrew Maclean
> <andrew.amaclean at gmail.com> wrote:
>> Interesting ... I have no problems, the only thing I can think of is that I
>> had VS 2010 SP1 installed before I installed VS 2012 Express, I did not use
>> any of the RC versions.
>
> Petr,
>
> A colleague mentioned that with the same setup he was getting the same
> error, and then installed SP1 for VS 2010 and things started working.
> It would really be great if there were better checks/errors because it
> is really a huge barrier for projects like VTK to get users to fight
> through install problems. "Hey you should use VTK for that" works when
> they have to follow a few instructions and it works, but when they
> have to spend days working through cryptic errors most tend to give up
> and then we lose a user.
>
> Andrew,
>
> I'm almost certain that it will never work using the VS generators
> (with very different "can't find the compiler type of errors") unless
> you run cmake-gui from a terminal unless you have manually added many
> VS things to the system environment variables. At least that has been
> my experience on many machines.
>
> David
> --
Here is my theory on mixing visual studios. When you install Visual Studio Windows will dutifully add the Visual Studio tools to the PATH for everyone. This is why you can just launch CMakeGui and have the Visual Studio generators work correctly. All is well. This is where I ran into problems.. Now install Visual Studio 2012 (or any other version) alonside VS2010 and Windows will again the 2012 to the PATH also. Now you have BOTH VS version's tools in the path but what ever is found FIRST is the one that is going to be used which will cause problems when launching CMakeGUi from Windows Explorer. At least this is what I saw years ago and why I NEVER mix versions. I install each version into its own Virtual Machine and run that way. It avoids all of these PATH issues.
Unless CMake has some code to look into the registry to fully determine which compiler you want and setup the environment correctly by removing PATHS from a version of Visual Studio that you are NOT using I don't see how having more than a single Visual studio installed is going to work***
*** It can work if you go into the "Environment Variables" for Windows and REMOVE any and all references to Visual Studio. Then when you want to configure a project you launch a "Visual Studio Command Prompt" or "Visual Studio x64 Command Prompt" and then launch CMake-gui from there which will properly setup the environment for you and the generator will work correctly every time because there is no mixing of paths. This is how I do it. Yes it is a few extra clicks and some typing but it avoids days of fighting hidden path issues.
Of course I could be wrong on most of the above but it works for me for the last 3 years so I am not about to change. Just my nickels worth of advice.
___________________________________________________________
Mike Jackson Principal Software Engineer
BlueQuartz Software Dayton, Ohio
mike.jackson at bluequartz.net www.bluequartz.net
More information about the CMake
mailing list