forked from qt-creator/qt-creator
CMakePM: Do not add sources to globbed targets
If a class is being added to a target that has a variable resulted from a `file(GLOB|_RECURSE)` call, we skip adding the files to the target. Do not add the files, just run CMake which would gather the new sources into the project. Adding sources to a globbed target will no longer open the CMakeLists.txt file, since nothing has changed. CMake will be run after adding, renaming and removing of sources files. Fixes: QTCREATORBUG-30445 Change-Id: I82e126737789f215a6400f5a43f303dcc57de005 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -187,9 +187,16 @@ void CMakeTargetNode::setConfig(const CMakeConfig &config)
|
||||
m_config = config;
|
||||
}
|
||||
|
||||
void CMakeTargetNode::setVisibleAfterAddFileAction(bool visibleAfterAddFileAction)
|
||||
{
|
||||
m_visibleAfterAddFileAction = visibleAfterAddFileAction;
|
||||
}
|
||||
|
||||
std::optional<FilePath> CMakeTargetNode::visibleAfterAddFileAction() const
|
||||
{
|
||||
return filePath().pathAppended(Constants::CMAKE_LISTS_TXT);
|
||||
if (m_visibleAfterAddFileAction)
|
||||
return filePath().pathAppended(Constants::CMAKE_LISTS_TXT);
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
void CMakeTargetNode::build()
|
||||
|
||||
Reference in New Issue
Block a user