Msys2-packages: CMake was unable to find a build program corresponding to "MSYS Makefiles"

Created on 9 Dec 2016  路  5Comments  路  Source: msys2/MSYS2-packages

I have a build problem on WIN10.
I updated msys using pacman

jdrewniak@W299 MINGW64 /c/msys64/home/jdrewniak/workspace/kicad/build/release
$ cmake -DCMAKE_BUILD_TYPE=Release -G "MSYS Makefiles" -DCMAKE_PREFIX_PATH=/c/msys64/mingw64/ -DCMAKE_INSTALL_PREFIX=/c/msys64/mingw64/ -DDEFAULT_INSTALL_PATH=/c/msys64/mingw64/ -DKICAD_SCRIPTING=ON -DKICAD_SCRIPTING_MODULES=ON -DKICAD_SRIPTING_WXPYTHON=ON ../../
CMake Error: CMake was unable to find a build program corresponding to "MSYS Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: CMake was unable to find a build program corresponding to "MSYS Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_AR was not found, please set to archive program.
-- Configuring incomplete, errors occurred!

I have tried -DCMAKE_PREFIX_PATH=/mingw64 also.

I had this problem on my other computer but somehow I managed this but I don't know how.
So this command works fine on my first computer.

cmake -DCMAKE_BUILD_TYPE=Release -G "MSYS Makefiles" -DCMAKE_PREFIX_PATH=/mingw64 -DCMAKE_INSTALL_PREFIX=/mingw64/ -DDEFAULT_INSTALL_PATH=/mingw64 -DKICAD_SCRIPTING=ON -DKICAD_SCRIPTING_MODULES=ON -DKICAD_SRIPTING_WXPYTHON=ON ../..

It is very cunfusing that I have same problem now.
CMakeCache.txt

Most helpful comment

I think you're missing make which is best installed by pacman --needed -S base-devel. You may also need to install the toolchain, as @mati865 says.

All 5 comments

Probably you have no compiler installed.
For 64 bit:
pacman --needed -S mingw-w64-x86_64-gcc
or
pacman --needed -S mingw-w64-x86_64-toolchain

I think you're missing make which is best installed by pacman --needed -S base-devel. You may also need to install the toolchain, as @mati865 says.

@elieux Yes, that was make - but I was sure that make from mingw-w64-x86_64-make will satisfy dependencies for cmake

It won't. First, the make from mingw-w64-x86_64-make is not make.exe but rather mingw32-make.exe and second, it has its own generator in CMake. Compare MSYS Makefiles and MinGW Makefiles.

Thank you so much this saved me after a day of time wasted. I ran the following and it worked for me:
pacman --needed -S mingw-w64-x86_64-gcc
pacman --needed -S mingw-w64-x86_64-toolchain
pacman --needed -S base-devel

Was this page helpful?
0 / 5 - 0 ratings