[CMake] VC2010 Express + CMake = fails

Robert Dailey rcdailey at gmail.com
Mon Nov 21 11:23:36 EST 2011


So I modified the CMakeVS10FindMake.cmake module to print the result of the
first call to find_program():

FIND_PROGRAM(CMAKE_MAKE_PROGRAM
  NAMES devenv
  HINTS

[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup\\VS;EnvironmentDirectory]

[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup;Dbghelp_path]
  "$ENV{ProgramFiles}/Microsoft Visual Studio 10.0/Common7/IDE"
  "$ENV{ProgramFiles}/Microsoft Visual Studio10.0/Common7/IDE"
  "$ENV{ProgramFiles}/Microsoft Visual Studio 10/Common7/IDE"
  "$ENV{ProgramFiles}/Microsoft Visual Studio10/Common7/IDE"
  "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 10.0/Common7/IDE"
  "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio10.0/Common7/IDE"
  "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 10/Common7/IDE"
  "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio10/Common7/IDE"
  "/Program Files/Microsoft Visual Studio 10.0/Common7/IDE/"
  "/Program Files/Microsoft Visual Studio 10/Common7/IDE/"
  )

  message( "Make Program: ${CMAKE_MAKE_PROGRAM}" )

The message I get is:

Make Program: C:/Program Files (x86)/Microsoft Visual Studio .NET
2003/Common7/IDE/devenv.com

I don't know how the above paths cause the VS2003 directory to be searched.

Here is my PATH:

C:\Perl\site\bin;C:\Perl\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program
Files\Intel\WiFi\bin\;C:\Program Files\Common
Files\Intel\WirelessCommon\;C:\Program Files\ThinkPad\Bluetooth
Software\;C:\Program Files\ThinkPad\Bluetooth
Software\syswow64;C:\SWTOOLS\ReadyApps;C:\Program Files (x86)\Microsoft SQL
Server\90\Tools\binn\;C:\Program Files\Perforce;C:\Program Files
(x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL
Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL
Server\100\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL
Server\100\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files (x86)\Microsoft
SQL Server\100\DTS\Binn\;C:\Program Files (x86)\Microsoft Visual Studio
9.0\Common7\IDE\PrivateAssemblies\;C:\Program Files (x86)\CMake
2.8\bin;C:\Program Files (x86)\Perforce;C:\bjam;C:\Program
Files\TortoiseSVN\bin;C:\pearlscripts;C:\patch\bin;"C:\Program Files
(x86)\IBM\Lotus\Domino";C:\PROGRA~2\IBM\Lotus\Domino;C:\Program
Files\TortoiseGit\bin;C:\Program Files (x86)\Git\cmd;C:\Program Files
(x86)\IBM\RationalPurifyPlus\Common;C:\sysinternals;C:\Program Files
(x86)\Microsoft Visual Studio .NET 2003\Vc7\bin;C:\Program Files
(x86)\Microsoft Visual Studio .NET 2003\Common7\IDE

I have VS2003 on my path apparently, I don't remember adding that... but
should this really break the find module? I don't think it should be
checking PATH, if that's what it is doing, since obviously it breaks it,
and it has no way of verifying what version of devenv it is getting.

---------
Robert Dailey


On Mon, Nov 21, 2011 at 9:12 AM, Robert Dailey <rcdailey at gmail.com> wrote:

> I have the following versions of VS installed:
>
> VS 2003
> VS 2005
> VS 2008
> VC 2010 Express
>
> So I can imagine there would be a lot of confusion :P
>
> FWIW, CMake can find VS 2003 and VS2008 just fine.
>
> I will look at the script and debug this a bit and then report back to you
> guys. Thanks for the guidance.
>
> ---------
> Robert Dailey
>
>
>
> On Mon, Nov 21, 2011 at 8:59 AM, Bill Hoffman <bill.hoffman at kitware.com>wrote:
>
>> On 11/21/2011 9:23 AM, Robert Dailey wrote:
>>
>>> I think though that by default, no visual studio installations place the
>>> install path in PATH in the environment. So if I'm remembering correctly
>>> and that is true, what other means does it use? Does it use the registry
>>> at all? If you could kindly describe the search path it uses that would
>>> be very helpful. The only other way for me to figure this out is to skim
>>> the source code, which would be very time consuming! Hopefully you can
>>> save me some time :)
>>>
>>>
>> The logic can all be found here:
>>
>> Modules/CMakeVS10FindMake.**cmake
>>
>> It is a very small file.  Obviously needs a bit of work.  It is finding
>> devenv.com on your machine when it should not.  We should most likely
>> check the version of what is found.  For the IDE PATH, LIB and INCLUDE are
>> not used or required.  PATH will be used if it finds devenv.com.  In
>> your case that is most likely what is happening.
>>
>> If you had a machine with only VS 10 express it would have worked fine. :)
>>
>> It is very hard to test things like this... :)
>>
>>
>> If you can tweak the CMake code in Modules/CMakeVS10FindMake.**cmake and
>> make it work on your machine, that would be great.
>>
>> Thanks.
>>
>> -Bill
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20111121/c98568bd/attachment.htm>


More information about the CMake mailing list