CLion - clean project

I am developing plugin for CLion and I need to "clean" the project. Which command do I need to use to do equivalent of a running a "make clean"?

 

This is how we get build command:

RunnerAndConfigurationSettings settings = RunManager.getInstance(project).getSelectedConfiguration();

BuildAndRunConfigurations configurations = ((CMakeAppRunConfiguration)settings.getConfiguration()).getBuildAndRunConfigurations();

CMakeConfiguration buildConfiguration = configurations.buildConfiguration;

File generatedDir = buildConfiguration.getConfigurationGenerationDir();

CMakeEnvironment environment = CMakeWorkspace.getInstance(project).getEnvironmentFor(buildConfiguration);

CMakeRunner runner = new CMakeRunner(environment);

final GeneralCommandLine cmd = runner.buildCommandLine(generatedDir,

                                                           Arrays.asList("--build", generatedDir.getPath(), "--target", buildConfiguration.getTarget().getName()),

                                                           true,

                                                           false);

cmd.addParameter("--");

cmd.addParameters(CMakeWorkspace.getInstance(project).getSettings().getEffectiveBuildOptionsList());

 

When I run "clean" from "Run" menu in the IDE, this is the command which is running:
CLion2017.1\system\cygwin_cmake\bin\cmake.exe --build "testcpp\cmake-build-debug" --target clean -- -j 8

How do we get this command?

1
1 comment

You can use  'com.jetbrains.cidr.cpp.execution.build.CMakeBuild#clean' for that

0

Please sign in to leave a comment.