Two targets into one app bundle?

Discussion in 'Mac Programming' started by caveman_uk, Jun 3, 2005.

  1. caveman_uk Guest

    caveman_uk

    Joined:
    Feb 17, 2003
    Location:
    Hitchin, Herts, UK
    #1
    Hi,

    I've got an xcode project with two targets - one is a cocoa app and the other is a shell tool which is called by the app to handle operations that require root access. Both build fine on their own.

    One problem. I want the shell tool to compile as a resource in the bundle for the app. I know I could just copy the tool into the app bundle but I was wondering if there was a way in xcode to do it so only one bundle is produced with everything in the right place?

    Thanks in advance for any ideas, links etc
     
  2. wrldwzrd89 macrumors G5

    wrldwzrd89

    Joined:
    Jun 6, 2003
    Location:
    Solon, OH
    #2
    I believe you need to do two things:

    1. Make the command-line application dependent on the cocoa application (I know, in reality, it's the other way around)
    2. Alter the build settings for the command line utility so that the executable ends up in the resources directory of the cocoa application.

    Making sure the Cocoa application builds first by creating a dependency will ensure that the resources directory exists when the command line utility gets built.
     
  3. caveman_uk thread starter Guest

    caveman_uk

    Joined:
    Feb 17, 2003
    Location:
    Hitchin, Herts, UK
    #3
    Thanks for the reply. In the end I thought of a way around it that didn't need me to write the helper tool...
     

Share This Page