CMakePM: Populate targets list on add new build step

The target list was recreated when the parsing of CMake project
finished.

But for already configured projects, the list was not used when
a new build step was added. This new step will only get the
targets list when the CMake project would be reparsed.

Fixes: QTCREATORBUG-25759
Change-Id: I54d12a71dacf9fcec2ad0f3e341fe8057880251d
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Cristian Adam
2021-09-16 17:28:47 +02:00
parent de8c90e9d9
commit a88f1426c3

View File

@@ -182,6 +182,9 @@ CMakeBuildStep::CMakeBuildStep(BuildStepList *bsl, Utils::Id id) :
m_buildTargetModel.setHeader({tr("Target")});
setBuildTargets({defaultBuildTarget()});
auto *bs = qobject_cast<CMakeBuildSystem *>(buildSystem());
if (bs && !bs->buildTargets().isEmpty())
recreateBuildTargetsModel();
setLowPriority();