CMake编译过程中出现Configuring incomplete的原因

在执行复杂的CMake编译脚本时遇到错误,问题源于一个库的编译后源码和CMake脚本未被删除,导致其他部分在编译时错误地包含了已删除文件的配置脚本,从而引发编译异常和Makefile未生成。删除错误库的非必要文件后,项目成功编译完成。
该文章已生成可运行项目,

记录犯的一个低级错误。

执行基于CMake写的一个个多层包含的复杂编译脚本时,总是报下面的错误:

CMake Deprecation Warning at /usr/src/googletest/googletest/CMakeLists.txt:48 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- Found PythonInterp: /usr/bin/python2 (found version "2.7.17") 
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.7.29
-- BUILD_SHARED_LIBS is on
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- Configuring incomplete, errors occurred!
See also "/workspace/pointpillar/builds/CMakeFiles/CMakeOutput.log".
See also "/workspace/pointpillar/builds/CMakeFiles/CMakeError.log".
make: Makefile: No such file or directory
make: *** No rule to make target 'Makefile'.  Stop.
make: *** No targets specified and no makefile found.  Stop.
make: *** No rule to make target 'install'.  Stop.

一下看不出嵌套的多层目录中哪个脚本有问题,折腾了一些时间,发现原来是随意犯了个严重错误,支持编译的多个库(包含头文件和so)里其中某个在编译后那些源码和cmake脚本没删掉,导致编译时里面的cmake脚本被包含调用了,里面指定的文件是临时文件编译完库后就被删掉了而不存在:

foreach(component ${config_reader_FIND_COMPONENTS})
    include(${CMAKE_CURRENT_LIST_DIR}/cr-${component}-config.cmake)
endforeach()

CMake Error at /home/fychen/libs/cr/cr-config.cmake:2 (include):

include could not find requested file:

这种非预期包含调用导致整个编译异常退出,从而Configuring incomplete发生了,Makefile没生成,将发生错误的这个库里除include和lib以外的库都删掉,然后编译整个项目就顺利完成了。

本文章已经生成可运行项目
评论 2
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Arnold-FY-Chen

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值