I have defined a custom target in cmake. I now want to ensure that this target is only build when the cmake target test
was executed. How can I achieve this.
Lets say that I have a target make coverage
which should depend on the target make test
to be called before, or call make test
before executing.
How can I define this behavior in cmake?
Here my code that did not work as expected. I want to achive that make coverage depend that make test has to be called before.
ADD_CUSTOM_TARGET(
coverage COMMAND /bin/bash ${LIBPIPE_BINARY_DIR}/cmake/scripts/coverage.sh
DEPENDS test
)