CMake-FLANN库未生成(对于PCL库)

问题描述 投票:1回答:1

我是CMake的新手,所以我总是更喜欢使用CMake GUI。

我实际上是在建立点云库(PCL)。但是,它还需要其他一些依赖库,其中之一是FLANN-> Git Link FLANN

到目前为止,我所做的是:

  1. 从链接Git Link FLANN下载了来源
  2. 创建了一个build目录
  3. 设置CMake源代码的路径-C:/PCL/flann-master

    设置CMake构建二进制文件路径-C:/PCL/flann-master/build

  4. 已选中已分组高级选项
  5. 配置

enter image description here

它出现以下错误:

CMake Warning (dev) at CMakeLists.txt:17 (if):
  Policy CMP0054 is not set: Only interpret if() arguments as variables or
  keywords when unquoted.  Run "cmake --help-policy CMP0054" for policy
  details.  Use the cmake_policy command to set the policy and suppress this
  warning.

  Quoted variables like "MSVC" will no longer be dereferenced when the policy
  is set to NEW.  Since the policy is not set the OLD behavior will be used.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at CMakeLists.txt:21 (if):
  Policy CMP0054 is not set: Only interpret if() arguments as variables or
  keywords when unquoted.  Run "cmake --help-policy CMP0054" for policy
  details.  Use the cmake_policy command to set the policy and suppress this
  warning.

  Quoted variables like "MSVC" will no longer be dereferenced when the policy
  is set to NEW.  Since the policy is not set the OLD behavior will be used.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Error at C:/Program Files/CMake/share/cmake-3.13/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.13/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  C:/Program Files/CMake/share/cmake-3.13/Modules/FindPkgConfig.cmake:39 (find_package_handle_standard_args)
  CMakeLists.txt:149 (find_package)

我的问题是:我需要做什么才能使其构建?

c++ visual-studio cmake point-cloud-library flann
1个回答
0
投票

错误日志的重要内容是此行:

找不到PkgConfig(丢失:PKG_CONFIG_EXECUTABLE)

与CMake一起使用PkgConfig并不是真正的跨平台解决方案,因为Windows并未安装pkg-config实用程序。 (PCL开发人员应该在其CMake中使用find_package()。也许,这值得在他们的Github上打开错误报告。)在Linux上,这很容易解决。您可以像这样安装pkg-config

sudo apt-get install pkg-config

但是,在Windows上,该过程涉及更多。有多种解决方案可在Windows pkg-config中安装here。我不确定哪个最适合您的情况,因此建议您仔细阅读其中的一些内容。在Windows机器上成功安装pkg-config实用程序后,清除CMake缓存,然后重新运行。这应该可以消除该错误,并允许您进行构建。

© www.soinside.com 2019 - 2024. All rights reserved.