Search code examples
cmakemingwmsys2

Compilation of cmake fails


When I try to compile cmake2.8.12.2 from sources on a MinGW MSYS2 system, I am getting the following error after running sh bootstrap:

make: No rule to make target '/cygdrive/e/software/pkg/cmake-2.8.12.2/Source /cmStandardIncludes.cxx', needed by 'cmStandardIncludes.o'. Stop.

I have checked Source directory and found cmStandardIncludes.cxx.Kindly help in this regard.Thanking you.

Output:

E:\software\pkg\cmake-2.8.12.2>sh bootstrap
---------------------------------------------
CMake 2.8.12.2, Copyright 2000-2012 Kitware, Inc.
C compiler on this system is: gcc
C++ compiler on this system is: g++
Makefile processor on this system is: make
g++ is GNU compiler
g++ does not have setenv
g++ does not have unsetenv
g++ has environ in stdlib.h
g++ has STL in std:: namespace
g++ has ANSI streams
g++ has streams in std:: namespace
g++ has sstream
g++ has operator!=(string, char*)
g++ has stl iterator_traits
g++ has standard template allocator
g++ has allocator<>::rebind<>
g++ does not have non-standard allocator<>::max_size argument
g++ has stl containers supporting allocator objects
g++ has header cstddef
g++ requires template friends to use <>
g++ supports member templates
g++ has standard template specialization syntax
g++ has argument dependent lookup
g++ does not have struct stat with st_mtim member
g++ has ios::binary openmode
g++ has ANSI for scoping
---------------------------------------------
make: *** No rule to make target '/cygdrive/e/software/pkg/cmake-2.8.12.2/Source
/cmStandardIncludes.cxx', needed by 'cmStandardIncludes.o'.  Stop.
---------------------------------------------
Error when bootstrapping CMake:
Problem while running make
---------------------------------------------
Log of errors: /cygdrive/e/software/pkg/cmake-2.8.12.2/Bootstrap.cmk/cmake_boots
trap.log
---------------------------------------------

Solution

  • If you want to use MinGW compiler, I suggest you use MinGW shell prompt instead of cygwin. This ensure that several MinGW compiler specific environment variables are correctly set.

    Pay attention, If you use MSYS you must use "MSYS Makefiles" generator and the make program should be called simply make (if you have installed it correctly) while if you use "MinGW Makefiles" as generator you must use mingw32-make as make program.

    If you generate "MinGW Makefiles" and call make, the wrong make program is called. Specify explicitely mingw32-make.