On 05/16/2017 10:18 AM, Sebastian Holtermann wrote:
> I thought per configuration source were supported already :/.

They are supported by Makefile and Ninja generators but not by others.

> 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.

> AddSource method that takes a second configuration parameter

No, the code model representation for per-config sources is based on
generator expressions.  At best such a method would just construct
the corresponding genex internally.

> 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.

> 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.

-Brad
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to