On 16.04.2015 22:25, Daniel Dilts wrote:
You can only add commands to a target that was defined in the current directory? So, I would have to have a new target for each directory and then have a target that depends on all of those targets?
I don't know your use case so I can not comment on what you have to do or should do.
Disregarding your use case ... to make it "work" (to stop cmake from complaining) all you have to do is move creation of the custom commands into the directory where the target is defined. The information required to create these commands may come from different scopes (e.g. you could maintain variables or global properties with the information required to construct the appropriate commands).
Nils -- 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