[CMake] Errors trying to use CMake to generate NMake makefiles.

Hal Canary hal at cs.unc.edu
Wed Jun 19 12:54:58 EDT 2013


I normally use CMake on Linux or MacOS, but I want to test the 
cross-platformness of my programs.  When I test on Windows with the 
"NMake Makefiles" Generator, I get the error "CMake Error: your CXX 
compiler: "cl" was not found."

In this console window, the commands cl and rc each work correctly.

Does anyone have any experience with using CMake and NMake?  Is there 
something broken in my system, or have I skipped some important step?

Here's the entire output:

     d:\cmaketest-build>CMake -G "NMake Makefiles" d:\cmaketest

     -- The C compiler identification is unknown
     -- The CXX compiler identification is unknown
     CMake Error: your RC compiler:
     "CMAKE_RC_COMPILER-NOTFOUND" was not found.  Please set
     CMAKE_RC_COMPILER to a valid compiler path or name.
     -- 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
     -- Using FREE VC TOOLS, NO DEBUG available
     -- Check for working C compiler: cl
     CMake Error at C:/Program Files (x86)/CMake
     2.8/share/cmake-2.8/Modules/CMakeRCInformation.cmake:22
     (GET_FILENAME_COMPONENT):
       get_filename_component called with incorrect number of
       arguments
     Call Stack (most recent call first):
       C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modul
       es/Platform/Windows-cl.cmake:28 (ENABLE_LANGUAGE)
       C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modul
       es/CMakeCInformation.cmake:60 (INCLUDE)
       CMakeLists.txt:2 (PROJECT)

     CMake Error: CMAKE_RC_COMPILER not set, after
     EnableLanguage
     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 (x86)/CMake 2.8/share/cm
     ake-2.8/Modules/CMakeTestCCompiler.cmake:52 (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):
       CMakeLists.txt:2 (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!

     d:\cmaketest-build>


More information about the CMake mailing list