On 03/31/2016 07:26 AM, Yves Frederix wrote: >> If anyone is interested in trying to implement generator expressions >> for custom command outputs, I can provide more details to get started. > > I am interested in having a go at this. I recently ran into this issue > at work as well and actually tried some things already. However, I > realized it was not that straightforward (not even talking about doing > it 'right' here ;)). Any pointers are welcome!
Thanks! The main challenge is shown in the cmTargetTraceDependencies::FollowName method where it calls cmMakefile::GetSourceFileWithOutput. This logic is done without knowledge of the current configuration. Therefore we cannot expand generator expressions of the available outputs because they may contain $<CONFIG>. Some table of pre-expanded per-config outputs mapping back to their cmSourceFile instances may need to be built. Achieving this may even require adding a generate-time companion of cmSourceFile that knows its configuration. It will need to be investigated further. cmTargetTraceDependencies::CheckCustomCommand currently has a loop over all configurations to generate the union of dependencies. This is used to allow generator expressions in the DEPENDS option. The cmTargetTraceDependencies logic may need to be refactored to move the loop over the configurations out to a higher level. We may need to trace dependencies separately for each configuration (for multi- config generators). Also see cmCustomCommandGenerator. The generators will need to be adapted to use this to get the custom command outputs with generator expressions expanded. They already do for the commands and dependencies. -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
