18 Sep
2018
18 Sep
'18
7:52 p.m.
On 18/09/18 17:47, Peter Dimov via Boost wrote:
Roger Leigh wrote:
One possibility:
if(NOT TARGET check) create_custom_target(check DEPENDS foo-check) else() add_dependencies(check foo-check) endif()
Sounds good.
How would this interact with enable_testing() and add_test()?
Since "check" is a non-standard target added by individual components, it shouldn't interact with enable_testing() and add_test() at all as far as I can see. (If the dependencies of the check target aren't built by default (ALL) and are also used by add_test() then that might be a potential problem, but I'd then question what the "check" target was really for in the first place… since testing is usually done by running ctest and not building a target.)