CMake in QtCreator 4.3 shows many automatic targets, how to remove/hide them?

╄→гoц情女王★ 提交于 2019-12-11 05:27:11

问题


I just switched to the last version of QtCreator (4.3.1) and the project explorer now shows many targets like ContinuousBuild, ContinuousConfigure, NightlyBuild, ExperimentalCoverage etc.

How can I remove all of these (or at least hide them) ?
I don't even know where this is generated in CMake.

Seems to be related to this question Hide automatically generated CTest targets except that I am not using CLion.


回答1:


You are probably using somewhere:

include(CTest)

According to the documentation:

Configure a project for testing with CTest/CDash

All those targets are pulled in by the combination of the two, CTest and CDash (almost all of them are due to the latter actually).
If you don't know why they are there and for what they can be used, probably you are using the wrong command.

If all what you want is to use only CTest, add tests with add_test and run them with make test, replace the line above with this one:

enable_testing()

The documentation is quite clear indeed:

Enable testing for current directory and below.

Clean up the build directory and run cmake from scratch from within QtCreator. All the targets you mentioned should disappear.


I had exactly the same problem in a project of mine when I updated QtCreator a couple of months ago. You can see in the history of the project the commit that solved the issue. Pretty short indeed.



来源:https://stackoverflow.com/questions/45169854/cmake-in-qtcreator-4-3-shows-many-automatic-targets-how-to-remove-hide-them

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!