CMakePM: Make "Autorun CMake" a global setting

The "Autorun CMake" is only visible in the Tools settings page when
the user clicks on CMake tool.

This is not very visible and it doesn't have to be per CMake version.

Change-Id: I57ded0b2e6a3ecb731bb8bc1495b6b61bc04c8b6
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Cristian Adam
2022-12-12 20:02:01 +01:00
parent 2a2455a6fa
commit 2f39b51bdc
8 changed files with 28 additions and 33 deletions

View File

@@ -5,6 +5,8 @@
#include "cmakeprocess.h"
#include "cmakeprojectmanagertr.h"
#include "cmakeprojectplugin.h"
#include "cmakespecificsettings.h"
#include "fileapidataextractor.h"
#include "fileapiparser.h"
@@ -106,7 +108,8 @@ void FileApiReader::parse(bool forceCMakeRun,
// * A query file is newer than the reply file
const bool hasArguments = !args.isEmpty();
const bool replyFileMissing = !replyFile.exists();
const bool cmakeFilesChanged = m_parameters.cmakeTool() && m_parameters.cmakeTool()->isAutoRun()
const auto settings = CMakeProjectPlugin::projectTypeSpecificSettings();
const bool cmakeFilesChanged = m_parameters.cmakeTool() && settings->autorunCMake.value()
&& anyOf(m_cmakeFiles, [&replyFile](const CMakeFileInfo &info) {
return !info.isGenerated
&& info.path.lastModified() > replyFile.lastModified();