diff --git a/src/plugins/cmakeprojectmanager/cmaketool.h b/src/plugins/cmakeprojectmanager/cmaketool.h index 42fa7b8f62d..54628910cc1 100644 --- a/src/plugins/cmakeprojectmanager/cmaketool.h +++ b/src/plugins/cmakeprojectmanager/cmaketool.h @@ -61,6 +61,8 @@ public: Utils::Id id() const { return m_id; } QVariantMap toMap () const; + void setAutorun(bool autoRun) { m_isAutoRun = autoRun; } + void setFilePath(const Utils::FilePath &executable); Utils::FilePath filePath() const; Utils::FilePath cmakeExecutable() const; diff --git a/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp b/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp index 8bc396ced1a..7e4c777317d 100644 --- a/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp +++ b/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp @@ -141,6 +141,7 @@ void CMakeToolManager::restoreCMakeTools() emit m_instance->cmakeToolsLoaded(); // Store the default CMake tool "Autorun CMake" value globally + // TODO: Remove in Qt Creator 13 auto settings = Internal::CMakeSpecificSettings::instance(); if (settings->autorunCMake.value() == settings->autorunCMake.defaultValue()) { CMakeTool *cmake = defaultCMakeTool(); diff --git a/src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.cpp b/src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.cpp index 43f1915709f..cfce81f005f 100644 --- a/src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.cpp +++ b/src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.cpp @@ -4,6 +4,7 @@ #include "cmaketoolsettingsaccessor.h" #include "cmakeprojectmanagertr.h" +#include "cmakespecificsettings.h" #include "cmaketool.h" #include @@ -185,9 +186,14 @@ void CMakeToolSettingsAccessor::saveCMakeTools(const QList &cmakeTo data.insert(QLatin1String(CMAKE_TOOL_DEFAULT_KEY), defaultId.toSetting()); int count = 0; - for (const CMakeTool *item : cmakeTools) { + for (CMakeTool *item : cmakeTools) { Utils::FilePath fi = item->cmakeExecutable(); + // Gobal Autorun value will be set for all tools + // TODO: Remove in Qt Creator 13 + const auto settings = CMakeSpecificSettings::instance(); + item->setAutorun(settings->autorunCMake.value()); + if (fi.needsDevice() || fi.isExecutableFile()) { // be graceful for device related stuff QVariantMap tmp = item->toMap(); if (tmp.isEmpty())