[cmake-developers] [PATCH] nmake/jom: Only warn about bad VS environment if compiler not found

James Johnston JamesJ at motionview3d.com
Wed Aug 5 17:26:32 EDT 2015


Hi,

Attached is a patch that changes the warning of nmake/jom generators when
VCVarsAll.bat hasn't been run:

   nmake and jom generators no longer warn about missing INCLUDE/LIB
   environment variables unless the C/CXX compiler cannot be found.  This
   is useful if the user does not want to use these generators with the
   Visual C++ compiler, or they do not want to enable any language.

Sample output; this was run from a clean cmd.exe - i.e. without having run
VCVarsAll.bat:

C:\Users\JamesJ\AppData\Local\Temp\cmake-warn-build>..\cmake-build\bin\cmake
"-GNMake Makefiles JOM" ../cmake-warn
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:3 (project):
  The CMAKE_C_COMPILER:

    cl

  is not a full path and was not found in the PATH.

  To use the JOM generator with Visual C++, cmake must be run from a shell
  that can use the compiler cl from the command line.  This environment is
  unable to invoke the cl compiler.  To fix this problem, run cmake from the
  Visual Studio Command Prompt (vcvarsall.bat).

  Tell CMake where to find the compiler by setting either the environment
  variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path
to
  the compiler, or to the compiler name if it is in the PATH.


CMake Error at CMakeLists.txt:3 (project):
  The CMAKE_CXX_COMPILER:

    cl

  is not a full path and was not found in the PATH.

  To use the JOM generator with Visual C++, cmake must be run from a shell
  that can use the compiler cl from the command line.  This environment is
  unable to invoke the cl compiler.  To fix this problem, run cmake from the
  Visual Studio Command Prompt (vcvarsall.bat).

  Tell CMake where to find the compiler by setting either the environment
  variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full
path
  to the compiler, or to the compiler name if it is in the PATH.


-- Configuring incomplete, errors occurred!
See also
"C:/Users/JamesJ/AppData/Local/Temp/cmake-warn-build/CMakeFiles/CMakeOutput.
log".
See also
"C:/Users/JamesJ/AppData/Local/Temp/cmake-warn-build/CMakeFiles/CMakeError.l
og".

Best regards,

James Johnston
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-nmake-jom-Only-warn-about-bad-VS-environment-if-comp.patch
Type: application/octet-stream
Size: 16456 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20150805/699acd44/attachment-0001.obj>


More information about the cmake-developers mailing list