linux – 如何设置CMake搜索路径

linux – 如何设置CMake搜索路径,第1张

概述在我的CMakeLists.txt中 include (CheckFunctionExists.cmake) 当我运行ccmake时(我正在关注官方tutorial) CMake Error at CMakeLists.txt:10 (include): include could not find load file: CheckFunctionExists.cmake 但是, 在我的CMakeLists.txt中

include (CheckFunctionExists.cmake)@H_502_12@  

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

CMake Error at CMakeLists.txt:10 (include):   include Could not find load file:     CheckFunctionExists.cmake@H_502_12@  

但是,我有指定的文件:

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

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

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

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

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

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

,在本教程后面提到.

总结

以上是内存溢出为你收集整理的linux – 如何设置CMake搜索路径全部内容,希望文章能够帮你解决linux – 如何设置CMake搜索路径所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/1025143.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-23
下一篇 2022-05-23

发表评论

登录后才能评论

评论列表(0条)

保存