在我的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安装forms:
sw3@pc90313-sw3:~/learn_cmake/build$ cmake --version cmake version 2.8.10.1
如果指定了绝对path,那么一切正常,并生成一个工作的生成文件。 然而,这个解决方法远非理想(与教程不同)。 问题在哪里?
该路径被称为${CMAKE_ROOT}
。 所以适当的包含系统文件的命令是
include (${CMAKE_ROOT}/modulees/CheckFunctionExists.cmake)
,稍后在教程中提到。