Skip to content
提示找不到cmake文件
2025年8月13日 root

提示找不到cmake

已经安装了lib,但是提示找不到cmake

bash
sudo apt install libgeographic-dev
bash
Could not find a package configuration file provided by "GeographicLib" with any of the following names: GeographicLibConfig.cmake geographiclib-config.cmake

定位安装位置

bash
dpkg -L libgeographic-dev

注意:

txt
/usr/share/cmake
/usr/share/cmake/geographiclib
/usr/share/cmake/geographiclib/FindGeographicLib.cmake

CMakeLists.txt 寻找添加路径

txt
# 首先,将我们创建的 Find 模块所在目录添加到 CMAKE_MODULE_PATH 中
list(APPEND CMAKE_MODULE_PATH /usr/share/cmake/geographiclib)
# 然后使用 find_package
find_package(GeographicLib REQUIRED)

重新编译,即可消除找不到cmake文件错误

Last updated: