Clion: how to get all targets

I hope build RunnerAndConfigurationSettingsImpl for c, so How to get "Clion > Run/Debug configurations > Application > select a conf > click 'Target' > all targets", following is my current code, 
 
I hope get exist targets instead of set it.
 
RunManagerImpl rm = RunManagerImpl.getInstance(pj)

String fn = new java.io.File(curPath).name.replaceAll(/\.\w+$/, '')
RunConfiguration c = new CMakeAppRunConfiguration(pj, new CMakeAppRunConfigurationType().configurationFactories[0], fn)
BuildTargetData td = new BuildTargetData(pj.name, fn)
c.setTargetAndConfigurationData(new BuildTargetAndConfigurationData(td, "Debug"))
c.setExecutableData(new ExecutableData(td))
RunnerAndConfigurationSettingsImpl conf = new RunnerAndConfigurationSettingsImpl(rm, c, false)
conf
 
5 comments
Comment actions Permalink

What do you mean by "RunnerAndConfigurationSettingsImpl for c", what exactly do you want to achieve?

0
Comment actions Permalink

I means RunnerAndConfigurationSettings for exectuable c file.

0
Comment actions Permalink

Not sure I understand; what would the runner do?

0
Comment actions Permalink

I fix with following code:

//pj is my current project

CMakeAppRunConfigurationSettingsEditor confEd = new CMakeAppRunConfigurationSettingsEditor(pj, new CMakeBuildConfigurationHelper(pj))
confEd.targets
0
Comment actions Permalink

What functionality does your plugin have?
I'm afraid I cannot help, since I don't completely understant what you are trying to achieve.

0

Please sign in to leave a comment.