c++ - google-cloud-cpp CMake 生成失败

标签 c++ google-cloud-platform cmake cmake-gui google-cloud-cpp

我正在尝试构建 google-cloud-cpp,但出现错误(见下文)。我曾尝试使用 VC++ 和 g++ 构建它,但在使用这两种方法时我都遇到了同样的错误。我使用 cmake-gui。

  • 构建环境:Visual Studios 2017
    操作系统:Windows 10 专业版 64 位

  • 构建环境:Mingw-w64 8.1.0
    操作系统:Windows 10 专业版 64 位

目标:64 位

错误:

CMake Error at cmake/IncludeGMock.cmake:38 (add_library):
  Cannot find source file:

    D:/google-cloud-cpp/third_party/googletest/googletest/src/gtest-all.cc

  Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm
  .hpp .hxx .in .txx
Call Stack (most recent call first):
  cmake/GoogleCloudCppCommon.cmake:48 (include)
  google/cloud/CMakeLists.txt:42 (include)


CMake Error at cmake/IncludeGMock.cmake:38 (add_library):
  No SOURCES given to target: gmock
Call Stack (most recent call first):
  cmake/GoogleCloudCppCommon.cmake:48 (include)
  google/cloud/CMakeLists.txt:42 (include)

最佳答案

在 git 克隆之后 https://github.com/GoogleCloudPlatform/google-cloud-cpp.git

进入目录

运行 git submodule update --init

关于c++ - google-cloud-cpp CMake 生成失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52220754/

相关文章:

c++ - 帮助阵列

security - 谷歌云安全扫描器: Google account authentication error

python - 在 python Flask 应用程序中找不到 google-cloud-sdk

c++ - 带有子库和包含目录的库,我如何在 CMake 中做到这一点?

c++ - 从编译时已知的日历日期创建 `std::chrono::time_point`

c++ - Boost:Boost.Signals 中究竟有什么不是线程安全的?

c++ - 我应该只对原始 cpp 文件使用 add_executable() 还是通过 add_library() 创建一个库?

c++ - 无法使用 CMake 的 Visual Studio 生成器链接到子库/内部库/嵌入式库

c++ - 从函数返回字符串....限制?

google-app-engine - Google App Engine灵活部署抛出错误: (gcloud. app.deploy)HttpError访问