On 04/06/2016 09:59 AM, Yves Frederix wrote: > In order to implement this, CMake should be able to determine if the > result of resolving a generator expression depends on the > configuration or not.
Not necessarily. It can simply evaluate it with each configuration to be generated and the result for each compared. Build a list of sources with per-configuration activation marks. Use that to do the actual generation. This intermediate list/set/map may be needed internally to do post-genex/per-config source file lookup anyway. > Does the generator expression logic currently allow such check? I don't remember ;) >> A fallback approach could be to generate a wrapper source file >> that uses the preprocessor to conditionally include the real >> per-config source file based on the configuration. > > That would be an option as well. I suspect best by using the > CMAKE_INTDIR preprocessor define? No, that just defines a string literal that we can't switch off. I think it would be a source-specific generated macro name. -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