[windows-7] Running CMake on Windows

I am currently trying to get CMake to run on my Windows 7 (64-bit) system. I want to compile TagLib for later use with a Qt application I am working on. I would like to compile it with MinGW (not Visual C++ as in this other question).

I download the installer (cmake-2.8.3-win32-x86.exe) and install it (I also opt to add CMake to my path). I then go to the directory why the CMakeLists.txt file is and run cmake .. It then gives me this giant error.

C:\Users\Joel\Downloads\taglib-1.6.3>cmake .
CMake Warning at CMakeLists.txt:1 (project):
  To use the NMake 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.


-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Warning at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/Platform/Windows-cl.cmake:
28 (ENABLE_LANGUAGE):
  To use the NMake 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.
Call Stack (most recent call first):
  C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeCInformation.cmake:60 (INCLUDE)
  CMakeLists.txt:1 (project)


CMake Error: your RC compiler: "CMAKE_RC_COMPILER-NOTFOUND" was not found.   Please set CMAKE_RC_COM
PILER 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 Warning at CMakeLists.txt:2 (PROJECT):
  To use the NMake 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.


CMake Warning at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/Platform/Windows-cl.cmake:
28 (ENABLE_LANGUAGE):
  To use the NMake 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.
Call Stack (most recent call first):
  C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeCInformation.cmake:60 (INCLUDE)
  CMakeLists.txt:2 (PROJECT)


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/Modules/Platform/Windows-cl.cmake:28 (ENABLE_LANG
UAGE)
  C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/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/cmake-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:1 (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 compi
ler path or name.
-- Configuring incomplete, errors occurred!

C:\Users\Joel\Downloads\taglib-1.6.3>

I was kind of surprised that it failed so hard out of the box, considering it advertises itself as a cross-platform make.

I tried setting INCLUDE, LIB, and LIBPATH (Windows environment variables) all to my MinGW binaries directory (C:\MinGW\bin) but it's still giving me the same error. I also tried setting CMAKE_C_COMPILER and CMAKE_CXX_COMPILER to the location of g++ (C:\MinGW\bin\g++).

Does anyone know what's going on here?

SOLUTION:

Per tibur's suggestion, I ran the cmake GUI to create the make files. I then went into the directory taglib directory and ran mingw32-make.exe to do the actual build.

This question is related to windows-7 build-process mingw cmake taglib

The answer is


There is a vcvars32.bat in your Visual Studio installation directory. You can add call cmd.exe at the end of that batch program and launch it. From that shell you can use CMake or cmake-gui and cl.exe would be known to CMake.


Examples related to windows-7

ng is not recognized as an internal or external command Why am I getting ImportError: No module named pip ' right after installing pip? How to Delete node_modules - Deep Nested Folder in Windows Telnet is not recognized as internal or external command Multiple -and -or in PowerShell Where-Object statement How do I set ANDROID_SDK_HOME environment variable? Run Batch File On Start-up Why isn't .ico file defined when setting window's icon? How to access shared folder without giving username and password Can't start hostednetwork

Examples related to build-process

how to get docker-compose to use the latest image from repository How do I generate sourcemaps when using babel and webpack? How do I put all required JAR files in a library folder inside the final JAR file with Maven? How do I print a list of "Build Settings" in Xcode project? Running CMake on Windows Why maven? What are the benefits? How to get a dependency tree for an artifact? Can I compile all .cpp files in src/ to .o's in obj/, then link to binary in ./? How do I get Maven to use the correct repositories? Maven: add a dependency to a jar by relative path

Examples related to mingw

MINGW64 "make build" error: "bash: make: command not found" How to install MinGW-w64 and MSYS2? printf, wprintf, %s, %S, %ls, char* and wchar*: Errors not announced by a compiler warning? mingw-w64 threads: posix vs win32 Serial Port (RS -232) Connection in C++ What is difference between sjlj vs dwarf vs seh? Unable to specify the compiler with CMake to_string is not a member of std, says g++ (mingw) How to compile makefile using MinGW? Getting started with OpenCV 2.4 and MinGW on Windows 7

Examples related to cmake

Copy file from source directory to binary directory using CMake CMake error at CMakeLists.txt:30 (project): No CMAKE_C_COMPILER could be found Installing cmake with home-brew CMake does not find Visual C++ compiler What's the CMake syntax to set and use variables? How do I add a library path in cmake? How to build x86 and/or x64 on Windows from command line with CMAKE? Difference between using Makefile and CMake to compile the code Add external libraries to CMakeList.txt c++ Cmake is not able to find Python-libraries

Examples related to taglib

Running CMake on Windows Eclipse "cannot find the tag library descriptor" for custom tags (not JSTL!)