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

1

1

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.

Rickettsia answered 18/7, 2017 at 14:35 Comment(2)
Similar question for Visual Studio: https://mcmap.net/q/1313462/-how-to-hide-targets-in-visual-studio-from-cmake/2799037Honeysweet
Just to note that I've logged a feature request for CMake to provide a way to prevent the creation of these targets: gitlab.kitware.com/cmake/cmake/-/issues/21730Teillo
H
2

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.

Hourihan answered 18/7, 2017 at 15:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.