CMakeLists.txt 的 Apache Thrift 错误

Apache Thrift errors with CMakeLists.txt

我正在尝试为 Apache Thrift 构建 C++ 库,但我遇到了一个我无法完全破译的 cmake 错误,这是我为得到错误所遵循的一系列步骤

git clone https://git-wip-us.apache.org/repos/asf/thrift.git
cd thrift/lib/cpp
mkdir cmake-build
cmake ..

我得到的错误是

CMake Error at CMakeLists.txt:162 (include):
  include could not find load file:

    ThriftMacros

CMake Error at CMakeLists.txt:164 (ADD_LIBRARY_THRIFT):
  Unknown CMake command "ADD_LIBRARY_THRIFT".

其他人以前也遇到过这个错误吗?

这不是构建它的方法。您需要按照说明从根目录构建,否则您将错过一大堆 CMake 定义。

来自存储库根目录:

mkdir cmake-build && cd cmake-build
cmake .. -DBUILD_CPP:BOOL=ON