Run on target for CMake Applications not possible?
已回答
I'm sucessfully building QNX executables in CLion with CMake.
I get autogenerated "CMake Applications" as Run Targets, which of course, say that the binary is not a win32 application (cross compiled for qnx).
However, in the Run menu I can manage Targets and successfully add a ssh server target, which should do what I want it to do. Upload the executable to /tmp and run it..
But I cannot find a setting for Running the selected CMake Application on a specific target.
Any help?
请先登录再写评论。
Hello!
Sorry for the delay in response.
Run targets are not properly supported in CLion currently.
You can try using the Remote GDB Server configuration - https://www.jetbrains.com/help/clion/remote-gdb-server.html. It builds your target locally, uploads the binary to the remote machine, launches it under gdbserver, and connects the CLion debugger. But it's intended only for debugging, not running.
Any chance we will see this feature soon?
I have the following workflow.
- Compile in one environment (docker)
- Copy binary to ssh device
- Run on ssh device
This seems not too complicated and is exactly what “Run targets” seem to be for, but it is not supported for CLion Cmake Projects. Also, it seems it would be exactly what the Remote GDB Server is for, but I just want to run and not debug.
So to me, it seems like functionality is already there, we just need a menu option for it.
Any chance I can use some workaround to get this feature?
At the moment I have implemented “Remote External Tools”, to run the binary inside the SSH session before the actual run. I now need to copy the binary to the device before. This should work, but it needs to be configured in very small steps.
Hi,
we did the following workaround. For the templates for Application and GoogleTest we added an extra step between build and run, where we start an extern tool. that replaces the created executable with a windows “loader” exe that uploads the clion created executable to our target and then runs it, as if it where “local”.
That works not too bad.
Hi all!
We have the following detailed web help article for the “compile in Docker + debug on ssh device” scenario - https://www.jetbrains.com/help/clion/complicated-remote-scenarios.html. But it's indeed about debugging, not running, since it suggests using the “Remote GDB Server” configuration for which the "Run" button is disabled.
Here is the feature request about providing the possibility to run (not debug) an application in the cross-compilation scenario - CPP-34319. Feel free to comment or upvote it in order to get updates. See https://intellij-support.jetbrains.com/hc/en-us/articles/207241135-How-to-follow-YouTrack-issues-and-receive-notifications if you are not familiar with YouTrack.