cmake找不到pdal的配置文件 [英] cmake not finding a configuration file for pdal

查看:112
本文介绍了cmake找不到pdal的配置文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用CMake在Windows中配置点数据抽象库.我正在跟踪一个可以在此处找到的教程:

I am trying to configure the Point Data Abstraction Library in Windows using CMake. I am following a tutorial that can be found here:

我在命令提示符下使用以下命令:

I am using the following command in the command prompt:

C:\Users\name\PDALe\build> cmake .. -DCMAKE_PREFIX_PATH=C:\OSGeo4W64\lib\pdal\cmake 

但是,出现以下警告:

CMakeLists.txt:3上的CMake警告(find_package):找不到兼容的程序包"PDAL"的配置文件要求的版本为"1.6.0".考虑但不接受以下配置文件:C:/OSGeo4W64/lib/pdal/cmake/PDALConfig.cmake,版本:1.6.0(64位)

CMake Warning at CMakeLists.txt:3 (find_package): Could not find a configuration file for package "PDAL" that is compatible with requested version "1.6.0". The following configuration files were considered but not accepted: C:/OSGeo4W64/lib/pdal/cmake/PDALConfig.cmake, version: 1.6.0 (64bit)

这正是我要使用的配置文件,我不确定为什么不使用它.我见过类似的想法,但我想我已经将cmake指向了配置文件正确.

This is exactly the configuration file I want it to use, I'm not sure why it isn't using it. I have seen a similar idea, but I think I have directed cmake to the config file correctly.

我缺少一些简单的东西吗?有人知道这里出了什么问题吗?

Is there something simple I'm missing? Does anyone know what is going wrong here?

编辑:我当前的CMakeLists.txt如下:

Edit: My current CMakeLists.txt is as follows:

cmake_minimum_required(VERSION 2.8)
project(MY_PDAL_PROJECT)
find_package(PDAL REQUIRED CONFIG)
include_directories(${PDAL_INCLUDE_DIRS})
link_directories(${PDAL_LIBRARY_DIRS})
add_definitions(${PDAL_DEFINITIONS})
set(CMAKE_CXX_FLAGS "-std=c++11")
add_executable(tutorial Tutorial.cpp)
target_link_libraries(tutorial PRIVATE ${PDAL_LIBRARIES})

由于我问了这个问题,所以我只更改了 find_package(PDAL 1.6.0必需的配置)中的行 find_package(PDAL必需的配置).

I have only changed the line find_package(PDAL REQUIRED CONFIG) from find_package(PDAL 1.6.0 REQUIRED CONFIG) since I asked the question.

推荐答案

基本上,CMake告诉您它找到了64位版本的PDAL库,但与CMake推论出的位数不符编译器正在使用.

Basically, CMake is telling you that it has found a 64 Bit version of the PDAL library, but that does not match with the number of bits CMake has deduced you compiler is using.

因此,Cmake会将'(64bit)'添加到版本字符串中.

Therefore, Cmake is adding the '(64bit)' to the version string.

尝试再次检查您的环境是否实际上已设置为64位编译器.您应该能够从构建目录中某个位置的CMakeError.txt或CMakeOutput.txt文件中进行验证.

Try to double check that your environment is in fact set up to a 64 bit compiler. You should be able to verify that from the CMakeError.txt or CMakeOutput.txt files that are somewhere in your build directory.

要么通过编译器的路径提供线索,要么从编译器本身的第一行输出.例如我的说:

Either the path to the compiler will give you a clue, or the first output line from the compiler itself. For example mine says:

Microsoft(R)C/C ++为 x64

Microsoft (R) C/C++ Optimizing compiler version 19.14.26433 for x64

这篇关于cmake找不到pdal的配置文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆