繁体   English   中英

如何设置CMake搜索路径

[英]How to set CMake search paths

在我的CMakeLists.txt中

include (CheckFunctionExists.cmake)

当我运行ccmake (我正在关注官方教程

 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)

,在本教程后面提到。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM