[cmake-developers] source_group and generator expressions
Sebastian Holtermann
seblist at xwmw.org
Tue May 16 12:16:13 EDT 2017
>> Would TARGETNAME_autogen/moc_compilation_$<CONFIG>.cpp work with the
>> current state of VS and XCode? The file name is pretty much unique.
>
> Yes, though some work would still be needed to add the right exclusion
> code to Xcode.
Good, I'll stick with that name then.
For the rcc generated files the situation is similar.
I wonder if the $<CONFIG> based file names should be the default even
for single configuration generators. It would make the code and
documentation easier to maintain/comprehend.
Anyway I'll upload the branch with the AUTOGEN changes soon.
Maybe you guys can use it as test case for the XCode changes then.
>> AUTOGEN generated files the properties "GENERATED" and "SKIP_AUTOGEN"
>> must be set. This requires access to the cmSourceFile which is not
>> available when using the $<CONFIG> generator expression in the current
>> cmGeneratorTarget::AddSource.
>
> Use cmMakefile::GetOrCreateSource for each of the per-config names
> (and no generator expression) to get a `cmSourceFile*` and set its
> properties. Then add the source to the target with the generator
> expression in its name. The generators should match them up properly.
Good, that's exactly what I did already but I wasn't sure if it was
going to work.
>> Also cmGeneratorTarget::AddIncludeDirectory with configuration parameter
>> would be required to pass per configuration include directories.
>
> Pass include directories that contain generator expressions to filter
> or name by configuration.
Okay.
-Sebastian
More information about the cmake-developers
mailing list