Hide automatically generated CTest targets

2019-05-23 11:07发布

I'm using CMake and CTest in CLion. Annoyingly, CTest generates a load of targets that I don't care about:

  • Continuous
  • ContinuousBuild
  • ContinuousConfigure
  • ContinuousCoverage
  • ContinuousMemCheck
  • ContinuousStart
  • ContinuousSubmit
  • ContinuousTest
  • ContinuousUpdate
  • Experimental
  • ExperimentalBuild
  • ExperimentalConfigure
  • ExperimentalCoverage
  • ExperimentalMemCheck
  • ExperimentalStart
  • ExperimentalSubmit
  • ExperimentalTest
  • ExperimentalUpdate
  • Nightly
  • NightlyBuild
  • NightlyConfigure
  • NightlyCoverage
  • NightlyMemCheck
  • NightlyStart
  • NightlySubmit
  • NightlyTest
  • NightlyUpdate

These all show up in CLion. Quite annoying as I'm sure you'll agree. Is there solution to remove them? I'm open to any solution:

  1. Get CTest to not generate them in the first place.
  2. Delete the targets after CTest has created them.
  3. A setting in CLion to hide them.

2条回答
Ridiculous、
2楼-- · 2019-05-23 12:06

A possible solution that I'm not sure works 100% is to go to Run->Edit Configurations... in CLion and simply delete all the targets you don't want.

This seems to survive reloading the CMake configuration, and make clean.

查看更多
我欲成王,谁敢阻挡
3楼-- · 2019-05-23 12:13

Unless you are using CDash, the solution is very simple.

In your CMakefile replace

include(CTest)

with

enable_testing()
查看更多
登录 后发表回答