Hi, While using the NMake and JOM generators in CMake, I have come across this warning:
To use the [NMake | JOM] generator, cmake must be run from a shell that can use the compiler cl from the command line. This environment does not contain INCLUDE, LIB, or LIBPATH, and these must be set for the cl compiler to work. OK, so this is kind of a minor complaint, but this is an annoying warning if you aren't actually wanting Visual C++ in your environment. What if I was wanting to use those generators without setting up a Visual C++ environment with vcvarsall.bat? Example use cases where this warning is annoying: * Using it to invoke a superbuild where: (1) the superbuild itself does not use any languages (project command says NONE for languages), (2) the superbuild sets up the VCVars environment uniquely for each ExternalProject_Add. For example, I might have ExternalProject_Add to build both 32-bit and 64-bit versions of an ExternalProject. And so I'd have ExternalProject invoke VCVarsAll.bat uniquely for each environment. In this situation, running VCVars to silence the warning before invoking superbuild is NOT good, because now I have two "nested" VCVars environments: (1) if the VCVars invoked by the superbuild fails, it will be masked by the first call to VCVars, meaning you could end up building for the wrong environment - without error (VCVars doesn't return proper error codes), (2) and now you have a PATH/LIB/INCLUDE that has combined paths for both 32-bit and 64-bit building. * Using the NMake/JOM generators with non-Visual C++ compilers (which DOES seem to work without issue otherwise). In that case, of course I'm not going to run VCVarsAll as a preliminary step... I examined the CMake source code and found out that if either the INCLUDE or LIB environment variables are missing, then the warning is emitted. So I've worked around it for now by setting both variables to a semicolon ";" in my environment. But this hack doesn't pass the smell test for me, starting with the fact that it involves messing with my environment in a weird way and ending with relying on an undocumented detail of CMake. Can these warnings be either eliminated entirely or suppressed via a more documented method? I could probably provide a patch but I'm not sure which direction to take with it. Best regards, James Johnston -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake-developers