仅需遵循GitAhead,即可在“用于VS2017的x64本机工具命令提示符”中构建README。我要做的就是:
gitahead\build\release
目录并运行两次cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=C:\dev-tools\Qt\5.12.0\msvc2017_64 ../..
它构建完成并得到一个GitAhead.exe。
现在我想知道是否可以在Qt Creator中打开该项目。根据{{3}},我只需要在Qt Creator中打开CMakeLists.txt
。
起初那根本不起作用。通过反复试验,我提出了以下环境变量,这些变量必须在“选项”>“工具包”>“环境”中设置:
CC=cl
CXX=cl
LIB=C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\um\x64;C:\dev-tools\VisualStudioBuildTools\VC\Tools\MSVC\14.16.27023\lib\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x64
PATH=${PATH};C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x64;C:\dev-tools\VisualStudioBuildTools\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64
(这可能不是正确的方法,我不知道自己在做什么。)
但是现在我被卡住了。现在,当我单击“配置项目”时,我得到:
Running "C:\dev-tools\CMake\bin\cmake.exe -E server "--pipe=\\.\pipe\{7a503b92-9fbb-4075-960e-6a968505fe74}" --experimental" in C:\Users\andre\AppData\Local\Temp\QtCreator-lyJxiX\qtc-cmake-OgvZcaJK.
Starting to parse CMake project, using: "-DCMAKE_CXX_COMPILER:STRING=", "-DCMAKE_C_COMPILER:STRING=", "-DCMAKE_PREFIX_PATH:STRING=C:/dev-tools/Qt/5.12.0/msvc2017_64", "-DQT_QMAKE_EXECUTABLE:STRING=C:/dev-tools/Qt/5.12.0/msvc2017_64/bin/qmake.exe".
The C compiler identification is MSVC 19.16.27026.1
The CXX compiler identification is MSVC 19.16.27026.1
Check for working C compiler: C:/dev-tools/VisualStudioBuildTools/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64/cl.exe
Check for working C compiler: C:/dev-tools/VisualStudioBuildTools/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64/cl.exe -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Detecting C compile features
Detecting C compile features - done
Check for working CXX compiler: C:/dev-tools/VisualStudioBuildTools/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64/cl.exe
Check for working CXX compiler: C:/dev-tools/VisualStudioBuildTools/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64/cl.exe -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Detecting CXX compile features
Detecting CXX compile features - done
Found Git: C:/dev-tools/Git/cmd/git.exe (found version "2.20.1.windows.1")
CMake Warning (dev) at dep/libssh2/libssh2/CMakeLists.txt:52 (option):
Policy CMP0077 is not set: option() honors normal variables. Run "cmake
--help-policy CMP0077" for policy details. Use the cmake_policy command to
set the policy and suppress this warning.
For compatibility with older versions of CMake, option is clearing the
normal variable 'BUILD_SHARED_LIBS'.
This warning is for project developers. Use -Wno-dev to suppress it.
Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY) (found version "1.1.1a")
Could NOT find Libgcrypt (missing: LIBGCRYPT_LIBRARY LIBGCRYPT_INCLUDE_DIR)
Looking for include files windows.h, bcrypt.h
Looking for include files windows.h, bcrypt.h - not found
CMake Error at dep/libssh2/libssh2/src/CMakeLists.txt:170 (message):
No suitable cryptography backend found.
Configuring incomplete, errors occurred!
See also "C:/Users/andre/AppData/Local/Temp/QtCreator-lyJxiX/qtc-cmake-OgvZcaJK/CMakeFiles/CMakeOutput.log".
See also "C:/Users/andre/AppData/Local/Temp/QtCreator-lyJxiX/qtc-cmake-OgvZcaJK/CMakeFiles/CMakeError.log".
CMake Project parsing failed.
我尝试添加
OPENSSL_ROOT_DIR=C:\dev-projects\gitahead\dep\openssl\openssl
到环境变量,但这没什么区别。我不知道为什么CMake可以在命令行(在VS Command Prompt中)而不是Qt Creator中找到OpenSSL。我该如何调试呢?