0

CMake 构建google-cloud-cpp失败并出现以下错误:

$ cmake -H. -Bcmake-out
-- The CXX compiler identification is GNU 9.3.0
-- The C compiler identification is GNU 9.3.0
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
CMake Error at google/cloud/storage/CMakeLists.txt:17 (find_package):
  Could not find a package configuration file provided by
  "google_cloud_cpp_common" with any of the following names:

    google_cloud_cpp_commonConfig.cmake
    google_cloud_cpp_common-config.cmake

  Add the installation prefix of "google_cloud_cpp_common" to
  CMAKE_PREFIX_PATH or set "google_cloud_cpp_common_DIR" to a directory
  containing one of the above files.  If "google_cloud_cpp_common" provides a
  separate development package or SDK, be sure it has been installed.


-- Configuring incomplete, errors occurred!
4

1 回答 1

4

CMake 命令:

cmake -H. -Bcmake-out

只有在您安装了所有google-cloud-cpp依赖项后才能正常工作。从INSTALL.md文件中:

如果安装了所有依赖google-cloud-cpp并提供了 CMake 支持文件,那么编译和安装库需要两个命令:

cmake -H. -Bcmake-out
cmake --build cmake-out --target install

不幸的是,让您的系统进入这种状态可能需要多个步骤,以下部分描述了如何google-cloud-cpp在多个平台上安装。

它继续描述如何为多个平台单独安装每个依赖项。这是一个痛苦的过程,但更简单的方法是使用主README.md文件中描述的建议的 CMake 超级构建。这将为您下载并构建所有google-cloud-cpp依赖项。请尝试使用 CMake 超级构建命令:

cmake -Hsuper -Bcmake-out
于 2020-03-20T16:16:35.960 回答