Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » CMake and Remote Eclipse Projects
CMake and Remote Eclipse Projects [message #1005770] Mon, 28 January 2013 16:38 Go to next message
Derek Wood is currently offline Derek WoodFriend
Messages: 2
Registered: January 2013
Junior Member
Perhaps this is a topic that should go to the folks at CMake as well, but I've been able to have CMake generate an Eclipse C++ shared library project and have Eclipse clean and build my project as well as get the integrated debugger working. However, I was restricted to use Eclipse on the system that generated the CMake project files as the paths in the project files only applied to that system.

I would prefer to have myself work on my Windows machine and remote develop on my Linux system, but I use CMake as the build system (it generates the makefiles as well) and there are some steps in the CMake scripts that I want to execute, so I don't think I can easily transition to the Eclipse "automatic generation of makefiles" functionality. I am trying this on Juno SR1 with PTP (incl. RDT).

I've been reading up using RDT and experimenting with different methods (RSE vs. Remote Tools, dstore vs ssh, Remote GCC C/C++ Shared Library project vs Remote Makefile Project, Other Toolchain) for the last couple of days. I figured I'd first try to set up the project manually in Eclipse, and then maybe augment CMake to generate the project I end up with, if necessary. I've tried both RSE and Remote Tools and found myself getting further when using Remote Tools / SSH. After some small mishaps (like needing to point /bin/sh to /bin/bash) I was able to run the make/clean targets on my CMake generated makefile on my remote system from my local machine running Eclipse, however, there are some quirky things still so I don't consider this working:

- My manually-created remote project shows warnings in Eclipse about unresolved includes. I attempt to add the include path /usr/local/include (location on my remote system), which I can see through my remote connection in the Remote System Explorer perspective, but upon selecting "/usr/local/include" in C/C++ General -> Paths and Symbols -> GNU C++, a warning at the bottom states "The selected folder does not exist or not accessible." Is there a way to point this to

- I could not seem to be able to run CMake and make in the fashion that I wanted. I noticed in C/C++ Build if "Generate Makefiles automatically" is checked, then C/C++ Build -> Settings as more tabs available, allowing a prebuild and postbuild command to be issued. Since I have "Generate Makefiles automatically" unchecked (CMake generates them), I don't have fields for prebuild/postbuild commands and would like to use them. The prebuild command would run cmake, the post build command would be the install target, and the normal build command could then be threaded (make -j 5). Is there a way to get this to work in Eclipse?

Has anyone attempted to this before? Given a first glimpse, this seems possible, however I'm not having luck. I'm wondering if further development is needed which I may consider helping out with. Going through all of this trouble to get this working would definitely be worth it. Using nomachine or something else like that does not seem to be a good option for us at this point. Thanks.
Re: CMake and Remote Eclipse Projects [message #1005799 is a reply to message #1005770] Mon, 28 January 2013 19:15 Go to previous message
Derek Wood is currently offline Derek WoodFriend
Messages: 2
Registered: January 2013
Junior Member
I found a way to make the first bullet work. Please chime in if you know of a better way.

I went to C/C++ General -> Paths and Symbols -> Source Location -> Link Folder... I then chose "Remote Tools" from the dropdown and mapped "usr_local_include" to /usr/local/include. I then added usr_local_include to the include paths.

Unfortunately I have many shared library projects that refer to /usr/local/include, so I have to set up this linked folder in each project. Didn't see a way to do this once (ex: with working sets). I also have more than one include path (/usr/include) and have to do this for the libraries as well, so setting this mapping once somewhere would be nice. I was hoping RSE/Remote Tools would do it for me automatically.

Also, to add an issue to my second bullet, I get this error:

"collect2: cannot find `ld'"

I get this at the very end of the remote compilation. I would've figured this was a PATH issue, but it finds "make" just fine (I don't specify /usr/bin/make as the build program, just the default "make"). I don't receive this error through putty (ssh'd in bash) and using make there. Ideas?
Previous Topic:custom toolchain GCC linker inheritance issue
Next Topic:How to exclude directory from the GNU C++ "include directory"
Goto Forum:

Current Time: Sat Feb 06 18:51:40 GMT 2016

Powered by FUDForum. Page generated in 0.04043 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software