News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Single project, multiple binaries

Started by Conor, June 07, 2010, 08:46:16 PM

Previous topic - Next topic

Conor

Greetings Code::Blocks community.

I've been searching for a decent linux IDE for sometime now.
Having become terminally frustrated with the fundamentally
broken Anjuta project, I decided to give Code::Blocks a try
having heard many good things about it.

At the moment, I'm working on a client/server application. I've
run aground as to how to have two separate binaries in a single
project - one for the client and one for the server. Both
applications use the same code base so I'd rather not have to
construct a project for both. Is it possible to do this with Code
Blocks? I've tried setting a custom build for the main client and
server source files, but building produces a single binary with the
project's title.

I've given the documentation a cursory glance but I've not come
across a means of doing this. Am I overlooking something blatantly
obvious? Is this even possible?

I appreciate any advice, answers or insights you might have.

MortenMacFly

Quote from: Conor on June 07, 2010, 08:46:16 PM
I've run aground as to how to have two separate binaries in a single project - one for the client and one for the server. Both
applications use the same code base so I'd rather not have to construct a project for both. Is it possible to do this with Code
Blocks?
Certainly. A project can have 1..n "targets" which can be anything: A simple "command" target, a library or an executable... Have a look at the Code::Blocks project file - it's a good example to see how it's done there. Consult the documentation of Code::Block for help.

Notice that a workspace can include 1..n projects (just for completeness).
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

Conor

Quote from: MortenMacFly on June 07, 2010, 10:01:10 PM
Notice that a workspace can include 1..n projects (just for completeness).

With your advice, I've taken the approach of using a project for both the
client and server applications within a single workspace, adding the
common code base source files to both. This does exactly what I'm looking
for.

Thank you for taking the time to answer my question. I think I'll be sticking
with Code::Blocks for the foreseeable future, it's an excellent IDE.