On 10/03/2016 12:14 PM, Clifford Yapp wrote: > so what we need is not actually the test names themselves, > but a list of the executables used to run tests that are also defined > as build targets. [snip] > The list we need would thus be built up to contain all COMMAND > arguments to add_test that are also build targets in CMake.
The list would also need to include targets mentioned in generator expressions such as `$<TARGET_FILE:...>`. This will almost certainly be better done as a CMake feature implemented in C++. This was actually an early design philosophy: do the hard stuff in C++ so that complex logic is not needed in CMake-language code. > dependency of the custom target "check". Then, when the custom target > "check" executes, it will first make sure all of the test executables > (and their dependencies) have been built. Why do you need a "check" target instead of the CMake-defined "test" target? One could teach cmGlobalGenerator::AddGlobalTarget_Test an option to add a dependency on the "all" target from "test". Most projects do not have so many non-test targets that they cannot afford to build "all" before testing. Alternatively the implementation could directly add dependencies on targets referenced by tests. That may be a bit trickier though. -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