[cmake-developers] TARGET_OBJECTS and buildsystem replacement macros

Brad King brad.king at kitware.com
Wed Mar 19 15:09:38 EDT 2014


On 03/19/2014 01:41 PM, Stephen Kelly wrote:
> However, should the macro remain when generating the buildsystem files?

If the place in those files where the values get written is per-config
then they can be replaced with the literal config names.  Otherwise the
macros must be left so that the build system can substitute the config
name at build time.

> build/$(PROJECT_NAME).build/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/objlib.build/Objects-normal/$(CURRENT_ARCH)/objlib1.o
> 
> I guess I could replace that with CMAKE_PROJECT_NAME.

Yes, I think it is the root->GetMakefile()->GetProjectName() value.
It would take some investigation to determine if that is always the
right thing.  If so then cmGlobalXCodeGenerator::ComputeTargetObjects
could be taught to just use that instead of the placeholder.

>> This is necessary for universal binary builds because the architecture
>> is substituted at build time by Xcode.
> 
> This seems to be the remaining unknowable, right?

Yes.  When not building universal binaries we can probably hard-code
the one architecture to be built instead of using the placeholder.
When building universal binaries with Xcode anything that the project
does with the value of the generator expression will have to be aware
of multiple architectures anyway so perhaps we can just leave the
placeholder and let them deal with it.

> Can the arch be treated as 
> a dimension like the config? I'm not sure that's a reasonable amount of 
> work, but I'm just trying to figure out if it's solvable at all.

IIRC Xcode considers the arch to be a dimension but only accessible in
the .pbxproj file by some kind of [variant] syntax.

-Brad




More information about the cmake-developers mailing list