On 10/08/2014 09:55 AM, Adam Strzelecki wrote: > We lack OUTPUT for add_custom_target. > > I can work on OUTPUT support for add_custom_target if you want?
This is not just about add_custom_target, and it is not about OUTPUT. Custom targets have no explicit output by design, but they can have DEPENDS on custom commands that have outputs. Both add_custom_target and add_custom_command can run operations that produce side-effects. Both commands need a way to specify any side effects they produce. Perhaps a new option like "GENERATES" can be added for this. For example: add_custom_target(Provider COMMAND some-generator -o side-effect GENERATES side-effect ) or: add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/generator-stamp.txt COMMAND some-generator -o side-effect COMMAND ${CMAKE_COMMAND} -E touch generator-stamp.txt DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/generator-input.txt GENERATES side-effect ) The GENERATES value(s) would be marked with the GENERATED property. For Ninja we would add extra outputs to the generated rule and ask Ninja to restat them to avoid the always-rebuild case. For other generators no additional build system content is needed. > Together with new POLICY it will make sense, unless you have other > opinion on that. We need some kind of transition plan that may or may not be a policy. Let's get the design of the new interface done first. > But I guess it won't make it to 3.1? Absolutely not for 3.1. The feature freeze for it is upon us NOW and we haven't even started the design for the new behavior yet. We have plenty of time before 3.2 though to get it right. -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