anthonyvd
anthonyvd

Reputation: 7590

Is there a way to set up Eclipse to use another project's output as a library?

Let's say I have 3 projects in my Eclipse workspace, namely FooServer, FooClient and FooShared. I own and modify the code in all 3 of them regularly and both the server and client part use code from the shared part.

Is there a way to tell Eclipse I want FooShared to be used as a library in them, similar to Visual Studio's "Add Reference..." for .NET projects? (as opposed to setting everything up like the include path and all manually)

Upvotes: 1

Views: 67

Answers (1)

Moataz Elmasry
Moataz Elmasry

Reputation: 2519

This depends how these projects are built, and whether they have a makefile, etc... But as a simple answer, try going to your project properties, C++ project path, then you can add whatever other projects in the workspace. whether this is enough I don't know I never tried it myself

A better way is to explicitly add the libraries that your project depends on to the CMakeLists.txt file see this tutorial on how to import other targets to your project

Upvotes: 1

Related Questions