记录犯的一个低级错误。
执行基于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以外的库都删掉,然后编译整个项目就顺利完成了。
在执行复杂的CMake编译脚本时遇到错误,问题源于一个库的编译后源码和CMake脚本未被删除,导致其他部分在编译时错误地包含了已删除文件的配置脚本,从而引发编译异常和Makefile未生成。删除错误库的非必要文件后,项目成功编译完成。
9863





