How to run cmake with clion.jar
I make clion plugin to run valgrind, so I need run cmake(cmake --build path/to/out --target target_name) to build specific target, how to run it, I don't understand /home/roroco/Downloads/clion-1.2.2/lib/clion.jar!/com/jetbrains/cidr/cpp/cmake/CMakeRunner.class#runCMake parameters
@org.jetbrains.annotations.NotNull
public com.intellij.execution.process.ProcessOutput runCMake(@org.jetbrains.annotations.NotNull java.io.File file, @org.jetbrains.annotations.NotNull java.io.File file1, @org.jetbrains.annotations.NotNull java.util.List<java.lang.String> list, boolean b, @org.jetbrains.annotations.NotNull java.util.Map<java.lang.String,java.lang.String> map) throws com.jetbrains.cidr.cpp.cmake.CMakeException { /* compiled code */ }
Please sign in to leave a comment.
How the user is supported to interact with the plugin, if it's using run configuration then you probably need another way to do it in code.
If you share some details on the workflow I'd be able to help you better.
see my https://youtu.be/UfRxziDPleU, I hope control start "Messages Build" and force kill "Messages Build" how to do that?
To build the selected run configuration you can use the following snippet:
new CMakeTargetAction.Build() {
@Override
public void doBuild(@NotNull Project project) { super.doBuild(project);}
}.doBuild(<pass project here>)
what about force kill "Messages Build", when I
I the return list size is 0, I can't find CMake Build Descriptors, How to get its process and kill it?
Sorry, I don't understand what you are trying to achieve.
Maybe you could describe your idea?
I use following code to run build
If I run a build and I change code in this term and I run build again, the 2nd build doesn't run(see my screencast https://youtu.be/LyLLsf896cw), so I need to force kill previous cmake build.
In the original post you wrote
>I make clion plugin to run valgrind, so I need run cmake
If you plan to use run configuration, please see http://www.jetbrains.org/intellij/sdk/docs/basics/run_configurations.html documentation.
You'll probably need to extend CMakeAppRunConfiguration in order to get all 'build' and 'run' features for free.
"I make clion plugin to run valgrind, so I need run cmake", I think I fix it, "kill previous cmake build" is my extra problem.
I think extending CMakeAppRunConfiguration doesn't work since
return list with size 0, that means, even I extending CMakeAppRunConfiguration, I have no way to get it, so is there other way?
another question: If I extend CMakeAppRunConfiguration, how to save build info(for instance, process pid) in whole clion running time?
Sorry, can't understand what you mean. Maybe step-by-step description of what you already have could help. Also, as I asked previously the general idea of the plugin might make things more clear
In action, I start debug session and I can get it's process pid, where to save process pid. I mean, as we know:
can get all RunContentDescriptor, where do these descriptors save, how should I do same thing?
If you run a CMake configuration it should be in the list of allDescriptors, and you can get ProcessHandler via com.intellij.execution.ExecutionManager#getRunningProcesses.
I'm very sure the descriptor is not exist(see my screencast https://youtu.be/PfR2GB7W264 > watch tool, the list size is 0) since in cmake build duration, the run configuration haven't run
My tmp solution is, when cmake build, I can find
in process manager, so I can kill -s KILL it
again, please answer my question, how to persistently save java instance in action for other action use, for instance, save CMakeAppRunConfiguration instance and use it in another action