本文主要是介绍CMake Error: The source “xxx“ does not match the source “yyy“ used to generate cache. Re-run cmake,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
目录
- 场景复现
- 解决方案
- 找到我们的编译路径
- 重新使用CMake编译
场景复现
今天使用CMake再次编译fmt源码时,cmake抛出一个错误。告诉我找不到一个路径,但我这个电脑本就没有这个路径。仔细一看这个路径是我在另一个电脑编译的路径。我就猜测可能是缓冲文件在捣乱。
CMake Error: The source “E:/C++Project/fmt/CMakeLists.txt” does not match the source “F:/C++Project/fmt/CMakeLists.txt” used to generate cache. Re-run cmake with a different source directory.
cmake界面:
解决方案
找到我们的编译路径
删掉这个文件,这个文件保留了上次的编译的信息。
重新使用CMake编译
重新使用cmake编译,就不会抛出这种错误了。可以正常编译咯。
这篇关于CMake Error: The source “xxx“ does not match the source “yyy“ used to generate cache. Re-run cmake的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!