Sophus问题: Sophus_INCLUDE_DIRS 为空, Sophus头文件与库文件找不到的问题
# fatal error: sophus/se3.hpp: No such file or directory
```sh
fatal error: sophus/se3.hpp: No such file or directory
#include
^~~~~~~~~~~~~~~~
compilation terminated.
rgbd/CMakeFiles/joinMap.dir/build.make:62: recipe for target 'rgbd/CMakeFiles/joinMap.dir/joinMap.cpp.o' failed
make[2]: *** [rgbd/CMakeFiles/joinMap.dir/joinMap.cpp.o] Error 1
CMakeFiles/Makefile2:234: recipe for target 'rgbd/CMakeFiles/joinMap.dir/all' failed
make[1]: *** [rgbd/CMakeFiles/joinMap.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
```
# Sophus_INCLUDE_DIRS 为空
```cmake
find_package(Sophus REQUIRED)
~ include_directories(
+ ${Sophus_INCLUDE_DIRS}
+ )
message("Sophus_INCLUDE_DIRS: " ${Sophus_INCLUDE_DIRS})
```
发现 Sophus_INCLUDE_DIRS 是没有输出的, 查了一下新版Sophus里并没有Sophus_INCLUDE_DIRS这个变量。
因为这个现在是不需要设置的,新的使用方法为
```sh
cmake_minimum_required(VERSION 3.0)
project(useSophus)
add_executable(useSophus useSophus.cpp)
target_link_libraries(useSophus
Sophus::Sophus
)
```
No comments