[CMake] how to build cmake with mingw and msys?

LM lmemsm at gmail.com
Tue Aug 14 09:17:05 EDT 2012


I built and used cmake on DeLi Linux with no issues, but every time I
try it on Windows, I seem to have problems.  My latest attempt, I just
downloaded version 2.8.9.  I'm using mingw (gcc 4.6.2) and msys.  From
within msys, I tried running ./bootstrap --system-libs --system-zlib
--system-bzip2 --system-libarchive --system-curl --no-qt-gui
--prefix=/usr/local --docdir=/usr/local/share/doc/CMake
--mandir=/usr/local/share/man --verbose
It errors out with:

make: `cmake' is up to date.
loading initial cache file
C:/mingw/msys/home/lm/bld/src/cmake/mingw/tmp/cmake-2.8.9/Bootstrap.cmk/InitialCacheFlags.cmake
-- The C compiler identification is GNU 4.6.2
-- The CXX compiler identification is GNU 4.6.2
-- Check for working C compiler: c:/MinGW/bin/gcc.exe
-- Check for working C compiler: c:/MinGW/bin/gcc.exe -- broken
CMake Error at Modules/CMakeTestCCompiler.cmake:52 (MESSAGE):
  The C compiler "c:/MinGW/bin/gcc.exe" is not able to compile a simple test
  program.

  It fails with the following output:

   Change Dir: C:/MinGW/msys/home/lm/bld/src/cmake/mingw/tmp/cmake-2.8.9/
CMakeFiles/CMakeTmp

  Run Build Command:C:/MinGW/msys/bin/make.exe
  "cmTryCompileExec2155929314/fast"

  make -f CMakeFiles/cmTryCompileExec2155929314.dir/build.make
  CMakeFiles/cmTryCompileExec2155929314.dir/build

    make: make: Command not found

  make: *** [cmTryCompileExec2155929314/fast] Error 127

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:14 (PROJECT)

-- Configuring incomplete, errors occurred!
---------------------------------------------
Error when bootstrapping CMake:
Problem while running initial CMake
---------------------------------------------

My path is set to:
PATH=/usr/local/bin:/mingw/bin:/opt/perl/bin:/bin:/usr/bin:/c/util

I have the msys version of make at /bin/make.exe and my compiler is at
/mingw/bin/gcc.exe

I tried searching on the web and the cmake mailing list for
instructions to build cmake with mingw and msys, but nothing I found
shed any light on fixing this issue.  (I also tried running
./bootstrap without the extra configuration switches.  Same problem.)
What are the appropriate steps to get cmake to build using msys?  Is
there anything I can do to prevent the error during building?  Any
help in getting this to build properly would be greatly appreciated.
Thanks.


More information about the CMake mailing list