gpt4 book ai didi

c++ - CMake - FLANN 库不构建(对于 PCL 库)

转载 作者:太空宇宙 更新时间:2023-11-04 12:30:38 26 4
gpt4 key购买 nike

我是 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)

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

最佳答案

我以这种方式在 Windows(使用 Visual Studio 2015)上构建 FLANN (x64):

在主要的 CMakeLists.txt 中,我像这样注释掉了 lz4 部分:

#if( NOT WIN32)
# find_package(PkgConfig REQUIRED)
# pkg_search_module(LZ4 REQUIRED liblz4)
#endif()

我已经将lz4.hlz4hc.hlz4.clz4hc.c复制到./src/cpp/flann/util目录

现在我已经生成了 Visual Studio 解决方案,在 flann 解决方案中,我手动添加了 lz4.clz4hc.c 到源。(如果您想构建绑定(bind)和 FLANN 库的其他部分,请将相同的源也添加到他们的解决方案中)。

构建项目,它将正确构建。

关于c++ - CMake - FLANN 库不构建(对于 PCL 库),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58770804/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com