From 4a0df73b53c183c2d408084da315d7fea45fd79a Mon Sep 17 00:00:00 2001 From: Volker Vogelhuber Date: Thu, 6 Nov 2014 11:27:24 +0100 Subject: [PATCH] don't deploy static libraries build using cmake Change-Id: I00f0fb2474620f86ca4d50a2e47c8ee4bf69239b Reviewed-by: Daniel Teske --- src/plugins/cmakeprojectmanager/cmakeproject.cpp | 13 +++++++------ src/plugins/cmakeprojectmanager/cmakeproject.h | 8 +++++++- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakeproject.cpp b/src/plugins/cmakeprojectmanager/cmakeproject.cpp index d19792f49f0..4a8ca6e937b 100644 --- a/src/plugins/cmakeprojectmanager/cmakeproject.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeproject.cpp @@ -362,7 +362,7 @@ QStringList CMakeProject::buildTargetTitles(bool runnable) const { QStringList results; foreach (const CMakeBuildTarget &ct, m_buildTargets) { - if (runnable && (ct.executable.isEmpty() || ct.library)) + if (runnable && (ct.executable.isEmpty() || ct.targetType != ExecutableType)) continue; results << ct.title; } @@ -626,7 +626,7 @@ void CMakeProject::updateRunConfigurations(Target *t) } foreach (const CMakeBuildTarget &ct, buildTargets()) { - if (ct.library) + if (ct.targetType != ExecutableType) continue; if (ct.executable.isEmpty()) continue; @@ -692,8 +692,9 @@ void CMakeProject::updateApplicationAndDeploymentTargets() if (ct.executable.isEmpty()) continue; - deploymentData.addFile(ct.executable, deploymentPrefix + buildDir.relativeFilePath(QFileInfo(ct.executable).dir().path()), DeployableFile::TypeExecutable); - if (!ct.library) { + if (ct.targetType == ExecutableType || ct.targetType == DynamicLibraryType) + deploymentData.addFile(ct.executable, deploymentPrefix + buildDir.relativeFilePath(QFileInfo(ct.executable).dir().path()), DeployableFile::TypeExecutable); + if (ct.targetType == ExecutableType) { // TODO: Put a path to corresponding .cbp file into projectFilePath? appTargetList.list << BuildTargetInfo(ct.title, Utils::FileName::fromString(ct.executable), @@ -1000,7 +1001,7 @@ void CMakeCbpParser::parseBuildTargetOption() } else if (attributes().hasAttribute(QLatin1String("type"))) { const QStringRef value = attributes().value(QLatin1String("type")); if (value == QLatin1String("2") || value == QLatin1String("3")) - m_buildTarget.library = true; + m_buildTarget.targetType = TargetType(value.toInt()); } else if (attributes().hasAttribute(QLatin1String("working_dir"))) { m_buildTarget.workingDirectory = attributes().value(QLatin1String("working_dir")).toString(); QDir dir(m_buildDirectory); @@ -1227,7 +1228,7 @@ void CMakeBuildTarget::clear() workingDirectory.clear(); sourceDirectory.clear(); title.clear(); - library = false; + targetType = ExecutableType; includeFiles.clear(); compilerOptions.clear(); defines.clear(); diff --git a/src/plugins/cmakeprojectmanager/cmakeproject.h b/src/plugins/cmakeprojectmanager/cmakeproject.h index cfb3d176a79..d380a1cd37c 100644 --- a/src/plugins/cmakeprojectmanager/cmakeproject.h +++ b/src/plugins/cmakeprojectmanager/cmakeproject.h @@ -61,11 +61,17 @@ namespace Internal { class CMakeFile; class CMakeBuildSettingsWidget; +enum TargetType { + ExecutableType = 0, + StaticLibraryType = 2, + DynamicLibraryType = 3 +}; + struct CMakeBuildTarget { QString title; QString executable; // TODO: rename to output? - bool library; + TargetType targetType; QString workingDirectory; QString sourceDirectory; QString makeCommand;