Commit 4887d28e authored by Milian Wolff's avatar Milian Wolff
Browse files

Run configure once to apply cmake preferences for CMake file api usage

When we use the cmake file API we have to run configure to reload the
model. In such a case, when we run configure to apply the new cmake
preferences, we can just run reloadModel directly. Otherwise, we'd
end up running configure twice.

BUG: 429605
parent fbb4b8d5
Pipeline #43245 passed with stage
in 32 minutes and 6 seconds
......@@ -39,6 +39,7 @@
#include "cmakebuilderconfig.h"
#include <debug.h>
#include <cmakeutils.h>
#include <cmakefileapi.h>
#include <interfaces/iproject.h>
#include <project/interfaces/ibuildsystemmanager.h>
#include <project/interfaces/iprojectbuilder.h>
......@@ -384,6 +385,13 @@ void CMakePreferences::removeBuildDir()
void CMakePreferences::configure()
{
if (CMake::FileApi::supported(CMake::currentCMakeExecutable(m_project).toLocalFile())) {
// the file api already does a configure internally when we reload the model
// so don't do it twice
m_project->reloadModel();
return;
}
IProjectBuilder *b=m_project->buildSystemManager()->builder();
KJob* job=b->configure(m_project);
if( m_currentModel ) {
......
Supports Markdown
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