"Dependencies listed with the DEPENDS argument may reference files and outputs of custom commands created with add_custom_command() in the same directory (CMakeLists.txt file)."
http://www.cmake.org/cmake/help/v2.8.8/cmake.html#command:add_custom_target On Tue, Aug 4, 2015 at 4:15 PM, Dan Liew <d...@su-root.co.uk> wrote: >> foolib is defined in this CMakeLists.txt: >> https://github.com/delcypher/cmake_add_custom_command_bug/blob/master/lib/CMakeLists.txt >> >> That is the (only) context in which you can extend the definition of the >> target with custom commands. > > Since when? I haven't seen that documented anywhere. IMHO this > behavior is counter-intuitive, in general I expect the scope of a > target to not depend on the cmake command I am trying to use. Seeing > as targets seem to be visible globally to all the commands (that I've > used so far) it seems to reasonable to me to expect > add_custom_command() to be able to see these targets too. > -- > > 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 -- 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