CMake: Add "test" target to cmake builds

Always show a test target for cmake projects. This will show even
if there are no tests in the project. But I think it is more annoying
*not* to be able to run tests via the locator when tests are available
than getting an error message when attempting that with a project that
does not have tests.

Task-number: QTCREATORBUG-18323
Change-Id: Iba85aa868cb9bfe6c3f44a7ffff620d081d3082f
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Tobias Hunger
2017-06-02 09:11:39 +02:00
parent 9f83808dc0
commit 460e1d7e93
3 changed files with 9 additions and 1 deletions

View File

@@ -334,6 +334,8 @@ QList<CMakeBuildTarget> BuildDirManager::buildTargets() const
m_buildTargets.append(utilityTarget(CMakeBuildStep::allTarget(), this));
m_buildTargets.append(utilityTarget(CMakeBuildStep::cleanTarget(), this));
m_buildTargets.append(utilityTarget(CMakeBuildStep::installTarget(), this));
m_buildTargets.append(utilityTarget(CMakeBuildStep::testTarget(), this));
m_buildTargets.append(m_reader->buildTargets());
}
return m_buildTargets;