Commit 37acb3b8 authored by Tobias Hunger's avatar Tobias Hunger
Browse files

Enable shadowbuilding by default for CMake projects

Reviewed-by: dt
parent 092fd7c2
......@@ -52,6 +52,7 @@ CMakeBuildConfiguration::CMakeBuildConfiguration(CMakeTarget *parent) :
BuildConfiguration(parent, QLatin1String(CMAKE_BC_ID)),
m_toolChain(0)
{
m_buildDirectory = cmakeTarget()->defaultBuildDirectory();
}
CMakeBuildConfiguration::CMakeBuildConfiguration(CMakeTarget *parent, CMakeBuildConfiguration *source) :
......@@ -61,6 +62,7 @@ CMakeBuildConfiguration::CMakeBuildConfiguration(CMakeTarget *parent, CMakeBuild
m_msvcVersion(source->m_msvcVersion)
{
cloneSteps(source);
m_buildDirectory = cmakeTarget()->defaultBuildDirectory();
}
QVariantMap CMakeBuildConfiguration::toMap() const
......@@ -74,7 +76,7 @@ QVariantMap CMakeBuildConfiguration::toMap() const
bool CMakeBuildConfiguration::fromMap(const QVariantMap &map)
{
m_msvcVersion = map.value(QLatin1String(MSVC_VERSION_KEY)).toString();
m_buildDirectory = map.value(QLatin1String(BUILD_DIRECTORY_KEY)).toString();
m_buildDirectory = map.value(QLatin1String(BUILD_DIRECTORY_KEY), cmakeTarget()->defaultBuildDirectory()).toString();
return BuildConfiguration::fromMap(map);
}
......@@ -91,10 +93,7 @@ CMakeTarget *CMakeBuildConfiguration::cmakeTarget() const
QString CMakeBuildConfiguration::buildDirectory() const
{
QString buildDirectory = m_buildDirectory;
if (buildDirectory.isEmpty())
buildDirectory = target()->project()->projectDirectory() + "/qtcreator-build";
return buildDirectory;
return m_buildDirectory;
}
ProjectExplorer::ToolChain::ToolChainType CMakeBuildConfiguration::toolChainType() const
......
......@@ -156,6 +156,11 @@ void CMakeProject::changeBuildDirectory(CMakeBuildConfiguration *bc, const QStri
parseCMakeLists();
}
QString CMakeProject::defaultBuildDirectory() const
{
return projectDirectory() + QLatin1String("/qtcreator-build");
}
bool CMakeProject::parseCMakeLists()
{
if (!activeTarget() ||
......
......@@ -97,6 +97,8 @@ public:
CMakeBuildTarget buildTargetForTitle(const QString &title);
QString defaultBuildDirectory() const;
bool parseCMakeLists();
signals:
......
......@@ -82,6 +82,11 @@ CMakeBuildConfigurationFactory *CMakeTarget::buildConfigurationFactory() const
return m_buildConfigurationFactory;
}
QString CMakeTarget::defaultBuildDirectory() const
{
return cmakeProject()->defaultBuildDirectory();
}
bool CMakeTarget::fromMap(const QVariantMap &map)
{
if (!Target::fromMap(map))
......
......@@ -59,6 +59,8 @@ public:
CMakeBuildConfigurationFactory *buildConfigurationFactory() const;
QString defaultBuildDirectory() const;
protected:
bool fromMap(const QVariantMap &map);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment