Re: How to set executable/product name by compiler switch?
Re: How to set executable/product name by compiler switch?
- Subject: Re: How to set executable/product name by compiler switch?
- From: Ken Thomases <email@hidden>
- Date: Fri, 8 Jan 2010 06:45:11 -0600
On Jan 8, 2010, at 5:11 AM, Alexander Bokovikov wrote:
> I have a compiler variable in my xxxxPrefix.pch like this
>
> #define _CUSTOM_VER_
>
> And I'd like to configure my XCode project in a way, which would allow me to build different executables like MyApp1.app and MyApp2.app depending on this compiler variable presence. In other words, I'd like to get MyApp1.app if I comment this line in .pch and MyApp2.app - if i uncomment this line.
>
> I suppose I need to write some script for my target or even create a new target, but I don't know what to do exactly, as I'm rather new in XCode.
It's easier to go in the other direction than what you're thinking of doing.
In Xcode's project and target build settings, you can define your own build settings. Then, you can add a macro definition to the pre-existing Preprocessor Macros build setting and base it on your custom build setting. That gets you back to where you were with putting a definition in the pre-compiled header, via a different route. (That is, you won't put a macro definition into the pre-compiled header. You'd set it in build settings. But the effect is the same.)
Now, you can also base other build settings on your custom build setting. In particular, you can base the product name of a target on it. Then, that automatically affects the executable name.
So, you have a single place where you can change a value and have it be reflected both in the macro definitions that affect compilation as well as affecting target/project properties.
Cheers,
Ken
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden