2016-12-17 18 views
2

Я пытаюсь построить gitql.Не удается запустить Cmake на окнах с MinGW и git bash

Я установил идти, CMake и MinGW, и пытался заставить их работать под мерзавцем Баш, но когда я называю CMake в gitql каталога я получаю эту ошибку:

-- Building for: NMake Makefiles 
-- The C compiler identification is unknown 
CMake Error at CMakeLists.txt:14 (PROJECT): 
    The CMAKE_C_COMPILER: 

    cl 

    is not a full path and was not found in the PATH. 

    To use the NMake generator with Visual C++, cmake must be run from a shell 
    that can use the compiler cl from the command line. This environment is 
    unable to invoke the cl compiler. To fix this problem, run cmake from the 
    Visual Studio Command Prompt (vcvarsall.bat). 

    Tell CMake where to find the compiler by setting either the environment 
    variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to 
    the compiler, or to the compiler name if it is in the PATH. 


-- Configuring incomplete, errors occurred! 
See also "C:/Go/src/github.com/cloudson/gitql/libgit2/CMakeFiles/CMakeOutput.log". 
See also "C:/Go/src/github.com/cloudson/gitql/libgit2/CMakeFiles/CMakeError.log". 
make: *** [prepare] B▒▒d 1 

Так что я пытался пункт GCC от MinGW с помощью:

export CC=/c/MinGW/bin/gcc.exe 

и когда я бегу сделать я получаю эту ошибку:

-- Check for working C compiler: C:/MinGW/bin/gcc.exe 
CMake Error: Generator: execution of make failed. Make command was: "nmake" "/NOLOGO" "cmTC_14ff0\fast" 
-- Check for working C compiler: C:/MinGW/bin/gcc.exe -- broken 
CMake Error at C:/Program Files/CMake/share/cmake-3.7/Modules/CMakeTestCCompiler.cmake:51 (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:/Go/src/github.com/cloudson/gitql/libgit2/CMakeFiles/CMakeTmp 



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



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





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


-- Configuring incomplete, errors occurred! 
See also "C:/Go/src/github.com/cloudson/gitql/libgit2/CMakeFiles/CMakeOutput.log". 
See also "C:/Go/src/github.com/cloudson/gitql/libgit2/CMakeFiles/CMakeError.log". 
make: *** [prepare] B▒▒d 1 

Как ча n Я сообщаю cmake использовать make вместо nmake? Я сделал установку в C:\Program Files (x86)\GnuWin32\bin, которая находится в $PATH.

Я также пытаюсь позвонить cmake -G "MinGW Makefiles", но я получил эту ошибку:

CMake Error: The source directory "C:/Go/src/github.com/cloudson/gitql" does not appear to contain CMakeLists.txt. 
Specify --help for usage, or press the help button on the CMake GUI. 
+0

Кстати: Используйте [ninja] (https://ninja-build.org/), намного эффективнее, чем make, и это хорошо поддерживается cmake. Это супер простая настройка (только один исполняемый файл будет добавлен к вашему пути), поэтому я действительно предлагаю вам попробовать. См. Https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html. Убедитесь, что где-то в файлах cmake, которые вы определяете: 'SET (CMAKE_COMPILER_IS_MINGW true CACHE BOOL) Обходное решение для правильной интерпретации пути") ' – Antonio

ответ

2

cmake -G "MinGW Makefiles" эффективно право команда информировать CMake вы хотите использовать MinGW.

Для полноты следует создать отдельную папку, давайте назовем его build и вызовите CMake из него, чтобы сделать вне источника сборки:

cd /path/to/build 
cmake -G "MinGW Makefiles" /path/to/CMakeLists.txt 

проблема здесь является gitql не предоставить любой файл CMakeLists.txt в репозитории, поэтому вы просто не можете использовать CMake для его создания, если только вы не создадите свой собственный файл проекта. Вы можете попробовать с данного Makefile и предложить его как запрос на вытягивание.

 Смежные вопросы

  • Нет связанных вопросов^_^