输出包括路径和 CMake
我想强制 CMake 在包含路径 (-I...
) 方面提供详细信息。考虑当前输出:
/D/Software/MinGW/bin/g++.exe -DQT_DEBUG -fmessage-length=0 -mfpmath=sse -msse2 -fopenmp -g3 -gdwarf-2 @CMakeFiles/go.dir/includes_CXX.rsp -o CMakeFiles/go.dir/main.cpp.obj -c /D/Users/Haroogan/Development/Workspace/New2/main.cpp
在任何地方,它都显示 @CMakeFiles/go.dir/includes_CXX.rsp
,而不是显示包含路径列表。事实上,该文件包含包含路径。
如何强制 CMake 或 Make 或其他内容输出包含路径?
I would like to force CMake to provide verbosity in terms of include paths (-I...
). Consider current output:
/D/Software/MinGW/bin/g++.exe -DQT_DEBUG -fmessage-length=0 -mfpmath=sse -msse2 -fopenmp -g3 -gdwarf-2 @CMakeFiles/go.dir/includes_CXX.rsp -o CMakeFiles/go.dir/main.cpp.obj -c /D/Users/Haroogan/Development/Workspace/New2/main.cpp
Everywhere, instead of showing a list of include paths, it rather shows @CMakeFiles/go.dir/includes_CXX.rsp
. Indeed, this file contains include paths.
How can I force CMake or Make or whatever to output include paths?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
当使用 Unix Makefiles(看起来像你一样)时,你可以通过键入来获取完整的命令行标志集,
我认为其他一些生成器也有一个可以设置的缓存变量。
When using Unix Makefiles (which it looks like you are) you can get the full set of command line flags by typing,
I think some of the other generators also have a cache variable that can be set.
参数 @CMakeFiles/go.dir/includes_CXX.rsp 实际上是传递给编译器的参数,编译器然后读取该文件并将其解释为选项列表。有关此机制的描述,请参见 man gcc。
使用该机制是因为 MS Windows 上的 shell 对命令行长度有限制,在复杂的编译调用中很容易超出该长度。因此使用文件来传递参数要安全得多
The parameter
@CMakeFiles/go.dir/includes_CXX.rsp
is in fact what is passed to the compiler, which then reads this file and interprets it as a list of options. See man gcc for description of this mechanism.The mechanism is used because shells on MS Windows have a limit to the length of the command line which can be easily exceeded in complex compilation calls. Therefore it is much safer to use files to pass parameters