加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

linux – 如何设置CMake搜索路径

发布时间:2020-12-14 00:53:19 所属栏目:Linux 来源:网络整理
导读:在我的CMakeLists.txt中 include (CheckFunctionExists.cmake) 当我运行ccmake时(我正在关注官方tutorial) CMake Error at CMakeLists.txt:10 (include): include could not find load file: CheckFunctionExists.cmake 但是,我有指定的文件: sw3@pc90313-s
在我的CMakeLists.txt中

include (CheckFunctionExists.cmake)

当我运行ccmake时(我正在关注官方tutorial)

CMake Error at CMakeLists.txt:10 (include):
   include could not find load file:

     CheckFunctionExists.cmake

但是,我有指定的文件:

sw3@pc90313-sw3:~/learn_cmake/build$find / -name CheckFunctionExists.cmake 2>/dev/null
/usr/share/cmake-2.8/Modules/CheckFunctionExists.cmake

我正在使用Ubuntu 13.04存储库的cmake安装:

sw3@pc90313-sw3:~/learn_cmake/build$cmake --version
cmake version 2.8.10.1

如果指定了绝对路径,那么一切都运行良好,并生成一个工作的makefile.但是,这种解决方法远非理想(并且与教程不同).问题出在哪里?

解决方法

该路径称为${CMAKE_ROOT}.所以系统文件的正确include命令是

include (${CMAKE_ROOT}/Modules/CheckFunctionExists.cmake)

,在本教程后面提到.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读