Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / Mac Programming / October 2006



Tip: Looking for answers? Try searching our database.

Multiple executables with XCode

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Raphael Mameghani - 17 Oct 2006 14:46 GMT
Hi!

I would like to have several executables within the same project. Is
this possible? Two seperate projects with a common library is not too
handy since the purpose of the executables would be to test the common
code in different contexts.

Raphael
vze35xda@verizon.net - 17 Oct 2006 15:32 GMT
Yes, you create a new project and then create multiple targets, 1 for
each exe and for the library.  (You can pick when you create the target
what type it is).  Then add the files to the project assiging them to
correct project.  By putting them in the same project the .h files
needed by the exe's from the library will automaticaly be found.  Also
you can specify for each project what other project it depends on.
That is your EXE's will depend on the library.  That way if the lib
code changes when you rebuild your exe it will do the lib first.

See the help in XCode.  It discusses the tradeoffs of doing this as
separate projects or one big project with multiple targets.

--jim

> Hi!
>
[quoted text clipped - 4 lines]
>
> Raphael
David Phillip Oster - 17 Oct 2006 15:32 GMT
In article <eh2mro$dd0$1@news.lrz-muenchen.de>,
Raphael Mameghani <contact_me_via_my_homepage@raphael.mameghani.de>
wrote:

> Hi!
>
[quoted text clipped - 4 lines]
>
> Raphael

Sure. Each executable is a separate target, and an umbrella target that
lists all the others as dependencies, but does nothing itself. Build the
umbrella, and it builds all the other targets.

I usually add a Unit Test target to my projects, that builds the
application, then links to the application as if it were a dynamic
library, so the unit test can create internal objects of the executable
without having to include the application's .m files.

See:

http://developer.apple.com/tools/unittest.html
Sherm Pendley - 17 Oct 2006 15:41 GMT
> I would like to have several executables within the same project. Is
> this possible?

It's not only possible, it's very well documented in the Xcode help. What
part of the process were you having trouble with?

sherm--

Signature

Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net

Chris Hanson - 18 Oct 2006 06:25 GMT
> I would like to have several executables within the same project. Is
> this possible?

Yes, this exactly what Xcode targets are for.  A target is a set of
instructions for generating a *build product* of some sort, typically
an executable, library, or plug-in bundle.

> Two seperate projects with a common library is not too handy since the
> purpose of the executables would be to test the common code in
> different contexts.

You may also want to look into Xcode's unit testing infrastructure.  It
will allow you to write tests for your framework that specify its
behavior and that can be run every time you press command-B to build
your project.

 -- Chris
Raphael Mameghani - 18 Oct 2006 16:31 GMT
> [the solution]

Thank you - now I understand the concept of targets. Sorry for my stupid
question but this is the first time I use a development environment such
as XCode (apart from Turbo Pascal;-) ).

Raphael
Simon Slavin - 20 Oct 2006 22:22 GMT
On 18/10/2006, Raphael Mameghani wrote in message <eh5hco$2qh$1@news.lrz-
muenchen.de>:

> Thank you - now I understand the concept of targets. Sorry for my stupid
> question but this is the first time I use a development environment such
> as XCode (apart from Turbo Pascal;-) ).

I hope we didn't make it sound like your question was stupid.  XCode is a
very complicated environment and lots of people discuss it here.  I've
seen far more stupid questions.

Simon.
Signature

http://www.hearsay.demon.co.uk

Raphael Mameghani - 25 Oct 2006 16:00 GMT
> On 18/10/2006, Raphael Mameghani wrote in message <eh5hco$2qh$1@news.lrz-
> muenchen.de>:
[quoted text clipped - 7 lines]
> very complicated environment and lots of people discuss it here.  I've
> seen far more stupid questions.

"Stupid" in such a sense that I easily could have figured out the
solution by myself;-)

Raphael
Simon Slavin - 19 Oct 2006 22:22 GMT
On 17/10/2006, Raphael Mameghani wrote in message <eh2mro$dd0$1@news.lrz-
muenchen.de>:

> I would like to have several executables within the same project. Is
> this possible?

One executable is one target.  Take a look at the examples included as
part of the Developer Tools.

/Developer/Examples/OpenGL/GLUT/GLUTExamples.xcodeproj/

is a good example.

Simon.
Signature

http://www.hearsay.demon.co.uk

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.