我正在完成CMake教程并与相关的项目文件进行交叉检查,我坚持第4步.
说明将这些行添加到顶级CMakeLists.txt文件中:
# does this system provide the log and exp functions?
include (CheckFunctionExists)
check_function_exists (log HAVE_LOG)
check_function_exists (exp HAVE_EXP)
如上所述,这是一个微不足道的测试,因为地球上的每个系统都具有log和exp.但它失败了.生成Makefile时,我明白了
-- Looking for log
-- Looking for log - not found
-- Looking for exp
-- Looking for exp - not found
如果我深入挖掘,运行cmake --trace,我会看到以下几行:
.../tutorial/src/CMakeLists.txt(19):  include( CheckFunctionExists )
/usr/share/cmake/Modules/CheckFunctionExists.cmake(32):  macro(CHECK_FUNCTION_EXISTS FUNCTION VARIABLE )
.../tutorial/src/CMakeLists.txt(20):  check_function_exists(log HAVE_LOG )
/usr/share/cmake/Modules/CheckFunctionExists.cmake(33):  if(HAVE_LOG MATCHES ^HAVE_LOG$ )
.../tutorial/src/CMakeLists.txt(21):  check_function_exists(exp HAVE_EXP )
/usr/share/cmake/Modules/CheckFunctionExists.cmake(33):  if(HAVE_EXP MATCHES ^HAVE_EXP$ )
在该CheckFunctionExists.cmake文件中,else该测试没有条件.我是cmake的新手,但测试似乎对我来说是真实的.我错过了什么?
CentOS 7,cmake 2.8.12.2
| 归档时间: | 
 | 
| 查看次数: | 817 次 | 
| 最近记录: |