forked from qt-creator/qt-creator
CMake: Display all targets in project settings
All targets should be displayed, even without binary artifacts, otherwise it's not possible to select a CMake custom target to build. Change-Id: I4b7640f460a248fd2d4b56428c2c8da3b13b9103 Reviewed-by: Daniel Teske <daniel.teske@digia.com> Reviewed-by: Yuchen Deng <loaden@gmail.com>
This commit is contained in:
@@ -410,11 +410,11 @@ QList<CMakeBuildTarget> CMakeProject::buildTargets() const
|
||||
return m_buildTargets;
|
||||
}
|
||||
|
||||
QStringList CMakeProject::buildTargetTitles() const
|
||||
QStringList CMakeProject::buildTargetTitles(bool runnable) const
|
||||
{
|
||||
QStringList results;
|
||||
foreach (const CMakeBuildTarget &ct, m_buildTargets) {
|
||||
if (ct.executable.isEmpty())
|
||||
if (runnable && (ct.executable.isEmpty() || ct.library))
|
||||
continue;
|
||||
if (ct.title.endsWith(QLatin1String("/fast")))
|
||||
continue;
|
||||
@@ -426,8 +426,6 @@ QStringList CMakeProject::buildTargetTitles() const
|
||||
bool CMakeProject::hasBuildTarget(const QString &title) const
|
||||
{
|
||||
foreach (const CMakeBuildTarget &ct, m_buildTargets) {
|
||||
if (ct.executable.isEmpty())
|
||||
continue;
|
||||
if (ct.title.endsWith(QLatin1String("/fast")))
|
||||
continue;
|
||||
if (ct.title == title)
|
||||
@@ -1103,8 +1101,7 @@ void CMakeCbpParser::parseBuildTarget()
|
||||
while (!atEnd()) {
|
||||
readNext();
|
||||
if (isEndElement()) {
|
||||
if (m_buildTargetType || m_buildTarget.title == QLatin1String("all") || m_buildTarget.title == QLatin1String("install"))
|
||||
m_buildTargets.append(m_buildTarget);
|
||||
m_buildTargets.append(m_buildTarget);
|
||||
return;
|
||||
} else if (name() == QLatin1String("Compiler")) {
|
||||
parseCompiler();
|
||||
|
Reference in New Issue
Block a user