On Tue, Sep 18, 2018 at 2:53 PM Roger Leigh via Boost
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.)
It exists because many, many users are used to building a library in these steps: ./configure make make check make install And with a check target, you get something eerily similar: cmake .. make make check make install Zach