Author Topic: Single project, multiple binaries  (Read 5229 times)

Offline Conor

  • Single posting newcomer
  • *
  • Posts: 2
Single project, multiple binaries
« on: June 07, 2010, 08:46:16 pm »
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.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: Single project, multiple binaries
« Reply #1 on: June 07, 2010, 10:01:10 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: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Conor

  • Single posting newcomer
  • *
  • Posts: 2
Re: Single project, multiple binaries
« Reply #2 on: June 07, 2010, 10:23:39 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.