Cmake Apache节俭编译C++;服务器
我不熟悉设置工具。对不起,问了个基本问题 我安装了Apache thrift,并成功地在Linux中运行了教程 我正在尝试创建并运行服务器。我正在使用CMAKE构建make文件。我刚刚从教程文件夹中复制了CMAKELIST.txt,并根据需要进行了更改 当我运行cmake时Cmake Apache节俭编译C++;服务器,cmake,thrift,Cmake,Thrift,我不熟悉设置工具。对不起,问了个基本问题 我安装了Apache thrift,并成功地在Linux中运行了教程 我正在尝试创建并运行服务器。我正在使用CMAKE构建make文件。我刚刚从教程文件夹中复制了CMAKELIST.txt,并根据需要进行了更改 当我运行cmake时 cmakecmakelist.txt 我得到以下错误 CMake Error at CMakeLists.txt:20 (include_directories): include_directories given e
cmakecmakelist.txt
我得到以下错误
CMake Error at CMakeLists.txt:20 (include_directories):
include_directories given empty-string as include directory.
CMake Error at CMakeLists.txt:27 (include):
include could not find load file:
ThriftMacros
CMake Error at CMakeLists.txt:38 (LINK_AGAINST_THRIFT_LIBRARY):
Unknown CMake command "LINK_AGAINST_THRIFT_LIBRARY".
您能给我指一下正确的方向吗?中定义了“链接到节俭库”的命令。如果要使用此命令,必须将
CMakeLists.txt
指向此宏文件。例如,如果将ThriftMacros.cmake
文件存储在源目录的子文件夹/cmake
中,则必须将以下行添加到CMakeLists.txt
:
list( APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake" )
include(ThriftMacros)
然后,您可以将目标链接到:
LINK_AGAINST_THRIFT_LIBRARY(some_target thrift)