forked from qt-creator/qt-creator
CMakeProjectManager: Support for multi-config generators
CMake has multi-config generators like: * Visual Studio * Xcode * Ninja Multi-Config The first two have different special targets for "all", "install", "package", "test" namely: "ALL_BUILD", "INSTALL", "PACKAGE", "RUN_TESTS". All of them need to get the build type passed via "--config <build- type>" and not via "CMAKE_BUILD_TYPE". The multi-config generators will use only one build directory. Fixes: QTCREATORBUG-24984 Change-Id: I8aa7ff73ce2af1e163b21a6504d26fcf95530edf Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -198,6 +198,16 @@ QString FileApiReader::ctestPath() const
|
||||
return m_lastCMakeExitCode == 0 ? m_ctestPath : QString();
|
||||
}
|
||||
|
||||
bool FileApiReader::isMultiConfig() const
|
||||
{
|
||||
return m_isMultiConfig;
|
||||
}
|
||||
|
||||
bool FileApiReader::usesAllCapsTargets() const
|
||||
{
|
||||
return m_usesAllCapsTargets;
|
||||
}
|
||||
|
||||
std::unique_ptr<CMakeProjectNode> FileApiReader::generateProjectTree(
|
||||
const QList<const FileNode *> &allFiles, QString &errorMessage, bool includeHeaderNodes)
|
||||
{
|
||||
@@ -240,13 +250,14 @@ void FileApiReader::endState(const QFileInfo &replyFi)
|
||||
const FilePath sourceDirectory = m_parameters.sourceDirectory;
|
||||
const FilePath buildDirectory = m_parameters.workDirectory;
|
||||
const FilePath topCmakeFile = m_cmakeFiles.size() == 1 ? *m_cmakeFiles.begin() : FilePath{};
|
||||
const QString cmakeBuildType = m_parameters.cmakeBuildType;
|
||||
|
||||
m_lastReplyTimestamp = replyFi.lastModified();
|
||||
|
||||
m_future = runAsync(ProjectExplorerPlugin::sharedThreadPool(),
|
||||
[replyFi, sourceDirectory, buildDirectory, topCmakeFile]() {
|
||||
[replyFi, sourceDirectory, buildDirectory, topCmakeFile, cmakeBuildType]() {
|
||||
auto result = std::make_unique<FileApiQtcData>();
|
||||
FileApiData data = FileApiParser::parseData(replyFi, result->errorMessage);
|
||||
FileApiData data = FileApiParser::parseData(replyFi, cmakeBuildType, result->errorMessage);
|
||||
if (!result->errorMessage.isEmpty()) {
|
||||
qWarning() << result->errorMessage;
|
||||
*result = generateFallbackData(topCmakeFile,
|
||||
@@ -274,6 +285,8 @@ void FileApiReader::endState(const QFileInfo &replyFi)
|
||||
m_rootProjectNode = std::move(value->rootProjectNode);
|
||||
m_knownHeaders = std::move(value->knownHeaders);
|
||||
m_ctestPath = std::move(value->ctestPath);
|
||||
m_isMultiConfig = std::move(value->isMultiConfig);
|
||||
m_usesAllCapsTargets = std::move(value->usesAllCapsTargets);
|
||||
|
||||
if (value->errorMessage.isEmpty()) {
|
||||
emit this->dataAvailable();
|
||||
|
||||
Reference in New Issue
Block a user