[CMake] NMake problems when upgrading to CMake 2.6.2

David Cole david.cole at kitware.com
Thu Oct 9 12:22:22 EDT 2008


Looks like the first part of your PATH might be confusing CMake:"C:\Program
Files\Microsoft Visual C++ Toolkit 2003\"\bin;

Try to get rid of the " characters in the PATH value...

(Especially if that's the one where "cl" is...)

If that's not it, we'll have to think of something else.

Also: I do not think "==" works as a comparison operator in batch files. I
have always used "EQU" instead of "==" -- see "help if" in a command prompt
for more info than you'll want...
as in:
  if "%VCTOOLKIT_VARS_ARE_SET%" EQU "true" goto done


:-)
David



On Thu, Oct 9, 2008 at 12:04 PM, Luke Kucalaba <lkucalaba at dsci.com> wrote:

>  Thanks David for the quick response.  Sorry I was having problems with
> message size, so I couldn't attach the files I wanted to originally.  I'll
> inline the vctoolkit.bat file here, which is a small DOS script we use to
> setup the MSVC71 toolkit environment:
>
>
>
> @echo off
>
>
>
> if "%VCTOOLKIT_VARS_ARE_SET%" == "true" goto done
>
>
>
> echo --- Setting Microsoft Visual C++ Toolkit 2003 environment variables...
> ---
>
>
>
> rem Load VC++ 7.1 standard environment variables
>
> call vcvars32.bat
>
>
>
> rem Prepend VC++ toolkit paths
>
> set PATH="%VCToolkitInstallDir%"\bin;%PATH%
>
> set INCLUDE="%VCToolkitInstallDir%"\include;%INCLUDE%
>
> set LIB="%VCToolkitInstallDir%"\lib;%LIB%
>
>
>
> set VCTOOLKIT_VARS_ARE_SET=true
>
>
>
> echo Done.
>
>
>
> :done
>
>
>
> @echo on
>
>
>
>
>
> Here's the output of the requested commands (although "where" is not a
> supported dos prompt command in Windows XP, so I couldn't run that one):
>
>
>
> N:\dsci\repo\WMI\trunk\wxWMI\src\nmake>vctoolkit
>
> --- Setting Microsoft Visual C++ Toolkit 2003 environment variables... ---
>
> Setting environment for using Microsoft Visual Studio .NET 2003 tools.
>
> (If you have another version of Visual Studio or Visual C++ installed and
> wish
>
> to use its tools from the command line, run vcvars32.bat for that version.)
>
> Done.
>
>
>
> N:\dsci\repo\WMI\trunk\wxWMI\src\nmake>cl
>
> Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077 for 80x86
>
> Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.
>
>
>
> usage: cl [ option... ] filename... [ /link linkoption... ]
>
>
>
> N:\dsci\repo\WMI\trunk\wxWMI\src\nmake>where cl
>
> 'where' is not recognized as an internal or external command,
>
> operable program or batch file.
>
>
>
> N:\dsci\repo\WMI\trunk\wxWMI\src\nmake>which cl
>
> 'which' is not recognized as an internal or external command,
>
> operable program or batch file.
>
>
>
> N:\dsci\repo\WMI\trunk\wxWMI\src\nmake>echo %PATH%
>
> "C:\Program Files\Microsoft Visual C++ Toolkit 2003\"\bin;C:\Program
> Files\Microsoft Visual Studio .NET 2003\Common7\IDE
>
> ;C:\Program Files\Microsoft Visual Studio .NET 2003\VC7\BIN;C:\Program
> Files\Microsoft Visual Studio .NET 2003\Common7\T
>
> ools;C:\Program Files\Microsoft Visual Studio .NET
> 2003\Common7\Tools\bin\prerelease;C:\Program Files\Microsoft Visual S
>
> tudio .NET 2003\Common7\Tools\bin;C:\Program Files\Microsoft Visual Studio
> .NET 2003\SDK\v1.1\bin;C:\WINDOWS\Microsoft.N
>
> ET\Framework\v1.1.4322;C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\;C:\Program
> Files\Borland\BDS\4.0\Bin;C:\Program Fil
>
> es\Microsoft Visual Studio .NET 2003\Vc7\bin;C:\Program Files\CMake
> 2.6\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\Sy
>
> stem32\Wbem;C:\Program Files\Common Files\GTK\2.0\bin;C:\Program
> Files\doxygen\bin;C:\Program Files\ATI Technologies\ATI
>
> .ACE\Core-Static;C:\Documents and Settings\dsci\My Documents\Borland Studio
> Projects\Bpl;C:\Program Files\CMake 2.6\bin;
>
>
>
>
>
> Thanks
>
> Luke
>
>
>  ------------------------------
>
> *From:* David Cole [mailto:david.cole at kitware.com]
> *Sent:* Thursday, October 09, 2008 12:01 PM
> *To:* Luke Kucalaba
> *Cc:* cmake at cmake.org
> *Subject:* Re: [CMake] NMake problems when upgrading to CMake 2.6.2
>
>
>
> From your same command prompt that you ran cmake in (at "
> N:\dsci\repo\WMI\trunk\wxWMI\src\nmake") what is the output of:
>
>   cl
>
>   where cl
>
>   echo %PATH%
>
> ?
>
>
>
>
>
> On Thu, Oct 9, 2008 at 11:51 AM, Luke Kucalaba <lkucalaba at dsci.com> wrote:
>
> Our software team is having problems upgrading to CMake 2.6.2 from our
> current working build system that uses CMake 2.4.7.  In particular, we are
> using the "Visual Studio 7 .NET 2003", "NMake Makefiles", "Unix Makefiles",
> and "CodeBlocks - Unix Makefiles" project/makefile generators.
>
>
>
> The first problem we encountered was with generating "NMake Makefiles".  We
> use the "Microsoft Visual C++ Toolkit 2003" optimizing compiler in
> conjunction with the rest of the Visual Studio 7 .NET 2003 tools (like
> resource compiler and IDE), because we have a license for MSVC 7.1 and for
> the most part it does what we need it to do, and there is no reason for us
> to pay for an upgrade to another IDE or compiler on Windows.  Anyway, that
> being said, I wrote a MSDOS batch script (vctoolkit.bat, attached) that sets
> the appropriate combination of "Visual Studio 7 .NET 2003 Standard" and
> "Visual Studio  .NET Optimizing Toolkit" environment variables, by calling
> vcvars32.bat, and then by manually overriding the PATH,INCLUDE,LIB
> environment variables to point to the optimizing toolkit.  We also
> discovered that in addition to this, we needed to physically move a number
> of files out of the standard .NET bin folder so that the optimizing compiler
> wouldn't try to use those VC7 "standard" runtime files when performing
> multiple compile/link/compile/link steps internally (btw, the conflicting
> bin files we had to move are: c1.dll, c1xx.dll, c2.dll, cl.exe,
> cl.exe.config, link.exe, link.exe.config).  This was a bit challenging to
> set up at first (back when CMake 2.4.7 was released), but now we are
> satisfied that this method of configuring the command-line environment for
> nmake is satisfactory for our purposes and should invoke the optimizing
> compiler when using nmake (from .NET standard).
>
>
>
> I attached to this email a stdout/stderr dump of the cmake trace output.
>
>
>
> N:\dsci\repo\WMI\trunk\wxWMI\src\nmake>cmake --trace -G"NMake Makefiles" ..
> > nmake-gen-trace.log 2>&1
>
>
>
> -------------------------------------------------------
>
>   Generating NMake using CMake 2.6.2 (command-prompt)
>
> -------------------------------------------------------
>
>
>
> N:\dsci\repo\WMI\trunk\wxWMI\src\nmake>vctoolkit
>
> --- Setting Microsoft Visual C++ Toolkit 2003 environment variables... ---
>
> Setting environment for using Microsoft Visual Studio .NET 2003 tools.
>
> (If you have another version of Visual Studio or Visual C++ installed and
> wish
>
> to use its tools from the command line, run vcvars32.bat for that version.)
>
> Done.
>
>
>
> N:\dsci\repo\WMI\trunk\wxWMI\src\nmake>cmake -G "NMake Makefiles" ..
>
> -- The C compiler identification is unknown
>
> -- The CXX compiler identification is unknown
>
> -- Check for CL compiler version
>
> -- Check for CL compiler version - failed
>
> -- Check if this is a free VC compiler
>
> -- Check if this is a free VC compiler - yes
>
> -- Check CL platform
>
> -- Check CL platform - 64 bit
>
> -- Using FREE VC TOOLS, NO DEBUG available
>
> -- Check for working C compiler: cl
>
> CMake Error: your C compiler: "cl" was not found.   Please set
> CMAKE_C_COMPILER to a valid compiler path or name.
>
> CMake Error: Internal CMake error, TryCompile configure of cmake failed
>
> -- Check for working C compiler: cl -- broken
>
> CMake Error at C:/Program Files/CMake
> 2.6/share/cmake-2.6/Modules/CMakeTestCCompiler.cmake:32 (MESSAGE):
>
>   The C compiler "cl" is not able to compile a simple test program.
>
>
>
>   It fails with the following output:
>
>
>
>
>
>
>
>
>
>
>
>   CMake will not be able to correctly generate this project.
>
> Call Stack (most recent call first):
>
>   :2308322 (PROJECT)
>
>
>
>
>
> CMake Error: your C compiler: "cl" was not found.   Please set
> CMAKE_C_COMPILER to a valid compiler path or name.
>
> CMake Error: your CXX compiler: "cl" was not found.   Please set
> CMAKE_CXX_COMPILER to a valid compiler path or name.
>
> * Configuring incomplete, errors occurred!
>
>
>
>
>
> We did not encounter any problems like this when building MSVC71 NMake
> makefiles with CMake 2.4.7.  If anyone has any ideas or suggestions, it
> would be greatly appreciated.  I'm pretty much stumped and at this point I
> am willing to try anything to get this to work.  Thanks in advance.
>
>
>
> Sincerely,
>
> Luke
>
>
>
> Luke Kucalaba
>
> Senior Software Engineer
>
> D&S Consultants, Inc
>
> Columbus, Ohio
>
>
>
>
>
>
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20081009/14e4df3c/attachment-0001.htm>


More information about the CMake mailing list