0
votes

I encountered a problem for using Cmake to build the FLANN library. The compiler I use is the VS 2005 compiler.

There are some errors I got during the building process as follows. Thanks in advance. The FLANN source can be downloaded from 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 Warning (dev) at CMakeLists.txt:3 (add_definitions): Policy CMP0005 is not set: Preprocessor definition values are now escaped automatically. Run "cmake --help-policy CMP0005" for policy details. Use the cmake_policy command to set the policy and suppress this warning. This warning is for project developers. Use -Wno-dev to suppress it.

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".
1
If you're not planning to run make install you can just delete that line (where it calls install(TARGETS ...)), it will still compileszx
I have another problem now. My program has to use flann::Matrix<int> m , I don't know how to integrate the file made by Cmake into my project now. I got a file called flann_cpp.obj after compiling the project created by Cmake.user3217504

1 Answers

3
votes

For any future readers, this error is probably due to providing CMake with the wrong directory for the source code.

The source code directory needs to be the root directory (containing bin, src, examples etc) and not the src subdirectory.