我正在尝试构建FLAN库,以便在之后构建PCL库。
在使用CMake编译源代码时,我得到了一个错误。我想我遗漏了一些非常基本的东西。由于我找不到适用于我的系统的编译库,所以我必须自己构建它。
使用命令
~/flann-1.8.4-src/build> cmake ..
我得到了
CMake Error at src/cpp/CMakeLists.txt:86 (add_library):
No SOURCES given to target: flann
CMake Error at src/cpp/CMakeLists.txt:32 (add_library):
No SOURCES given to target: flann_cpp
在SLES11操作系统上,FLAN1.8.4和1.9.1会发生这种情况。
有什么提示吗?
下面是cmake的完整抄本:
-- Could NOT find HDF5 (missing: HDF5_LIBRARIES HDF5_INCLUDE_DIRS) (found version "")
CMake Warning at CMakeLists.txt:76 (message):
hdf5 library not found, some tests will not be run
-- Could NOT find GTest (missing: GTEST_LIBRARY GTEST_INCLUDE_DIR GTEST_MAIN_LIBRARY)
CMake Warning at CMakeLists.txt:115 (message):
gtest library not found, some tests will not be run
-- Found OpenMP_C: -fopenmp
-- Found OpenMP_CXX: -fopenmp
-- Found OpenMP: TRUE
CMake Warning at src/matlab/CMakeLists.txt:79 (message):
Cannot find MATLAB or Octave instalation. Make sure that the 'bin'
directory from the MATLAB instalation or that mkoctfile is in PATH
hdf5 library not found, not compiling flann_example.cpp
-- Could NOT find LATEX (missing: LATEX_COMPILER)
-- Install prefix: /usr/local
-- Build type: RelWithDebInfo
-- Building C bindings: ON
-- Building python bindings: ON
-- Building matlab bindings: ON
-- Building CUDA library: OFF
-- Using OpenMP support: ON
-- Using MPI support: OFF
-- Configuring done
CMake Error at src/cpp/CMakeLists.txt:86 (add_library):
No SOURCES given to target: flann
CMake Error at src/cpp/CMakeLists.txt:32 (add_library):
No SOURCES given to target: flann_cpp
-- Build files have been written to: ~/flann-1.8.4-src/build
发布于 2020-05-07 21:15:26
在你的flann目录运行中
touch src/cpp/empty.cpp
在src/cpp/CMakeLists.txt中替换
add_library(flann_cpp SHARED "") and add_library(flann SHARED "")
使用
add_library(flann_cpp SHARED empty.cpp) and add_library(flann SHARED empty.cpp)
希望这能有所帮助:) link,感谢Tsyvarev的评论
https://stackoverflow.com/questions/50763621
复制相似问题