在执行cmake打印命令之前 [英] Making cmake print commands before executing
问题描述
我正在开发一个用cmake在linux上构建的大型C ++项目。 Cmake运行良好,在模块和应用程序的树中生成一个Makefile的一部分。运行gnu make会导致链接器错误。在运行它们之前,如何让打印输出确切的命令?
I'm working on a large C++ project built with cmake on linux. Cmake runs okay, producing a horde of Makefiles in the tree of modules and applications. Running gnu make leads to linker errors. How can I get make to print out the exact commands before running them?
-d选项不打印命令,但大量的信息没有帮助。
The -d option does not print the commands, but plenty of information that hasn't been helpful.
-n选项打印所有命令,但不运行它们,所以我不能确定是什么麻烦。从make -n检查stdout,我没有看到任何相关的命令。我怀疑一些命令根据早期命令的结果而改变,而Makefile的层次结构使我们很难判断到底发生了什么。
The -n option prints all the commands, but does not run them, so I can't tell were exactly the trouble is. Examining the stdout from make -n, I don't see any commands that are relevant. I suspect some commands change depending on the results of earlier commands, and the hierarchy of Makefiles makes it difficult to tell what's really going on.
我没有看到任何其他
推荐答案
相当确定这会有效:
make VERBOSE=1
set(CMAKE_VERBOSE_MAKEFILE on)
这在 CMake常见问题。
这篇关于在执行cmake打印命令之前的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!