On 4 August 2015 at 14:32, Iosif Neitzke <iosif.neitzke+cm...@gmail.com> wrote: > And: > > "A target created in the same directory (CMakeLists.txt file) that > specifies any output of the custom command as a source file is given a > rule to generate the file using the command at build time." > > http://www.cmake.org/cmake/help/v3.3/command/add_custom_command.html
That documentation is for the first signature of ``add_custom_command()`` (Generating Files section in the docs) which I'm not using here. I'm using the other signature (Build Events in the docs) which mentions nothing about add_custom_command(TARGET ...) working only on targets created in the same directory. CMakes behaviour could be clearer here, it should probably raise an error rather than pretending that the target doesn't exist which is clearly does. > But it's not super clear in the documentation. Agreed! -- 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