2013-12-19 83 views
0

我遇到了使用Cmake构建FLANN库的问题。我使用的编译器是VS 2005编译器。Cmake:构建FLANN库

我在建筑过程中遇到了一些错误,如下所示。提前致谢。 的FLANN源可以从here


The C compiler identification is MSVC 14.0.50727 
The CXX compiler identification is MSVC 14.0.50727 
Check for working C compiler using: Visual Studio 8 2005 
Check for working C compiler using: Visual Studio 8 2005 -- works 
Detecting C compiler ABI info 
Detecting C compiler ABI info - done 
Check for working CXX compiler using: Visual Studio 8 2005 
Check for working CXX compiler using: Visual Studio 8 2005 -- works 
Detecting CXX compiler ABI info 
Detecting CXX compiler ABI info - done 

CMake的警告(DEV)在的CMakeLists.txt下载:3(add_definitions): 政策CMP0005未设置:预处理器定义值现在逃出 自动。运行“cmake --help-policy CMP0005”获取策略详细信息。使用 cmake_policy命令设置策略并取消此警告。 此警告适用于项目开发人员。使用-Wno-dev来抑制它。

CMake Error at CMakeLists.txt:115 (install): 
    install TARGETS given no ARCHIVE DESTINATION for static library target 
    "flann_cpp_s". 


CMake Warning (dev) in CMakeLists.txt: 
    No cmake_minimum_required command is present. A line of code such as 

    cmake_minimum_required(VERSION 2.8) 

    should be added at the top of the file. The version specified may be lower 
    if you wish to support older CMake versions for this project. For more 
    information run "cmake --help-policy CMP0000". 
This warning is for project developers. Use -Wno-dev to suppress it. 
Configuring incomplete, errors occurred! 
See also "C:/FlannLib/CMakeFiles/CMakeOutput.log". 
+0

如果你不打算运行'make install',你可以删除该行(它调用'install(TARGETS ...)'),它仍然会编译 – szx

+0

我现在有另一个问题。我的程序必须使用** flann :: Matrix m **,我不知道如何将Cmake制作的文件整合到我的项目中。在编译由Cmake创建的项目后,我得到了一个名为flann_cpp.obj的文件。 – user3217504

回答

1

对于任何未来的读者,这个错误可能是由于提供CMake的与错误的目录中的源代码。

源代码目录必须是根目录(包含bin,src,examples等),而不是src子目录。