有关The package name passed to `find_package_handle_standard_args` (CSPARSE)
does not match the name of the calling package (CSparse). 解决方案
0 错误提示
CMake Warning (dev) at /homepo/clion-2021.3.3/bin/cmakenux/cmake-3.21/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
The package name passed to `find_package_handle_standard_args` (CSPARSE)
does not match the name of the calling package (CSparse). This can lead to
problems in calling code that expects `find_package` result variables
(e.g., `_FOUND`) to follow a certain pattern.
- 在编译14讲第7讲的3d3d:ICP工程时候,出现这个警告但是仍然可以编译通过,但是实在是看着难受,就找到方案解决了
1 解决方案
- 会出现这个警告,你一定使用了slam14讲的cap7中cmake_modules文件夹,在CMakeLists.txt中是包含两句:
...
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_modules)
...
find_package(CSparse REQUIRED)
- 只需要,把cmake_modules文件夹下
FindCSparse.cmake
文件中的最后一行:
find_package_handle_standard_args(CSPARSE DEFAULT_MSG
CSPARSE_INCLUDE_DIR CSPARSE_LIBRARY)
修改为:
find_package_handle_standard_args(CSparse DEFAULT_MSG
CSPARSE_INCLUDE_DIR CSPARSE_LIBRARY)
即可