CMake Error : execution of make failed on Windows

久未见 提交于 2020-05-13 04:44:10

问题


I am getting errors when trying to build nanomsg project in Windows 7:

cmake ..
-- Building for: NMake Makefiles
-- The C compiler identification is GNU 4.7.1
-- Check for working C compiler: C:/Program Files (x86)/CodeBlocks/MinGW/bin/gcc.exe
CMake Error: Generator: execution of make failed. Make command was: "nmake" "/NOLOGO" "cmTC_5d837\fast"
-- Check for working C compiler: C:/Program Files (x86)/CodeBlocks/MinGW/bin/gcc.exe -- broken
CMake Error at C:/Program Files (x86)/cmake-3.9.4-win64-x64/share/cmake-3.9/Modules/CMakeTestCCompiler.cmake:51 (message):
The C compiler "C:/Program Files (x86)/CodeBlocks/MinGW/bin/gcc.exe" is not
able to compile a simple test program.

It fails with the following output:

Change Dir: C:/Users/User/Documents/Internal/nanomsg-master/build/CMakeFiles/CMakeTmp



Run Build Command:"nmake" "/NOLOGO" "cmTC_5d837\fast"



Generator: execution of make failed.  Make command was: "nmake" "/NOLOGO"
"cmTC_5d837\fast"





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


-- Configuring incomplete, errors occurred!
See also "C:/Users/User/Documents/Internal/nanomsg-master/build/CMakeFiles/CMakeOutput.log".
See also "C:/Users/User/Documents/Internal/nanomsg-master/build/CMakeFiles/CMakeError.log".

I use gcc compiler and make from Mingw toolchain and I can run succesfully gcc.exe and mingw32-make.exe on a simple example.

In the file CMakeCache.txt the cache variables are set as follows:

//C compiler
CMAKE_C_COMPILER:FILEPATH=C:/Program Files (x86)/CodeBlocks/MinGW/bin/gcc.exe

//Program used to build from makefiles.
CMAKE_MAKE_PROGRAM:STRING=nmake

I think that the problem comes from CMAKE_MAKE_PROGRAM variable it should take C:/Program Files (x86)/CodeBlocks/MinGW/bin/mingw32-make.exe, however i dont understand from where it gets the value nmake.

Even i replaced it manually I get the same problem.

My questions :

  • How CMake fills the Cache variables ?
  • Why CMAKE_MAKE_PROGRAM takes the value nmake ?
  • Why changing manually this variable didn t solve the problem ?

来源:https://stackoverflow.com/questions/46807753/cmake-error-execution-of-make-failed-on-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!