On 05/16/2017 05:52 AM, Sebastian Holtermann wrote: > There are two ways to achieve this > 1) Put TARGETNAME_autogen/$<CONFIG>/moc_compilation.cpp > into AUTOGEN_SOURCE_GROUP > - Requires gen. exp. support in source_group > > 2) Manually replace $<CONFIG> for all configurations and put all > variants into the AUTOGEN_SOURCE_GROUP > - Does not require gen. exp. support in source_group > - May flood the source_group with files from an other configurations? > Are source groups even configuration aware? > > I'd prefer 1) but does source_group support generator expressions?
I don't think so, but it could be taught to do so. The main challenge is supporting per-configuration sources, and that would have to be solved for either approach. Source groups are used in IDE generators to organize source files. The IDE project file formats tend to not have the Configuration as a parameter to their source groups. Instead all sources for all configurations get listed and then individual sources can be marked with conditions on a per-configuration basis. Recently I refactored the VS generators to support per-config source generation (via per-config exclusion rules). Currently it is limited somewhat artificially but the main generation infrastructure is there. OTOH the Xcode generator does not have a good way to do per-config source files. It has very limited support for excluding source files on a per-config basis but only by the *file name* ignoring the directory. -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