Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/cmake/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Cmake 如何安装CLI11?_Cmake - Fatal编程技术网

Cmake 如何安装CLI11?

Cmake 如何安装CLI11?,cmake,Cmake,我使用安装 我测试并希望使用find_包包含CLI11,但失败 CMakeLists.txt的内容 project(PackageTest CXX) cmake_minimum_required(VERSION 3.1) find_package(CLI11 CONFIG REQUIRED) ... 我得到的错误如下: CMake Error at CMakeLists.txt:6 (find_package): Could not find a package configurati

我使用安装

我测试并希望使用
find_包
包含
CLI11
,但失败

CMakeLists.txt的内容

project(PackageTest CXX)
cmake_minimum_required(VERSION 3.1)

find_package(CLI11 CONFIG REQUIRED)
...

我得到的错误如下:

CMake Error at CMakeLists.txt:6 (find_package):
  Could not find a package configuration file provided by "CLI11" with any of
  the following names:

    CLI11Config.cmake
    cli11-config.cmake

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


-- Configuring incomplete, errors occurred!
...

文档是。。。误导您不使用
find_package
安装库,而是使用库。你必须先安装它。因此,正如链接所说,要将CLI11链接到您的项目,您需要配置和安装项目,就像您使用任何其他外部库一样。之后,您可以使用
find_package
在项目中使用库<代码>mkdir生成cd生成cmake。。进行GTEST\U COLOR=1 CTEST\U OUTPUT\U ON\U FAILURE=1进行测试但它不起作用。文档是。。。误导您不使用
find_package
安装库,而是使用库。你必须先安装它。因此,正如链接所说,要将CLI11链接到您的项目,您需要配置和安装项目,就像您使用任何其他外部库一样。之后,您可以使用
find_package
在项目中使用库<代码>mkdir生成cd生成cmake。。使GTEST_COLOR=1 CTEST_OUTPUT_ON_FAILURE=1 make test但它不起作用。