# Depending on "all"

**URL:** <https://discourse.cmake.org/t/depending-on-all/4318>\
**Category:** Code\
**Created:** [October 22, 2021, 1:52pm UTC](https://discourse.cmake.org/t/depending-on-all/4318 "2021-10-22T13:52:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Braden](https://discourse.cmake.org/user_avatar/discourse.cmake.org/braden/32/358_2.png) [@Braden](https://discourse.cmake.org/u/Braden)\
**Post date:** [October 22, 2021, 1:52pm UTC](https://discourse.cmake.org/t/depending-on-all/4318/1 "2021-10-22T13:52:24Z")

</div>

I’ve created an [`installcheck`](https://www.gnu.org/prep/standards/html_node/Standard-Targets.html) target. Rather than having this depend on `install` (which would be affected by the configure-time value of `CMAKE_INSTALL_PREFIX`), it depends on an `installcheck-install` target that calls `cmake_install.cmake` with a value for `CMAKE_INSTALL_PREFIX` that is subordinate to the builddir.

This works just fine if the software has already been built (i.e., `cmake --build /path/to/builddir`); but if it has not, it will fail because `installcheck-install` doesn’t depend on `all` (or equivalent). By the looks of [issue 8438](https://gitlab.kitware.com/cmake/cmake/-/issues/8438), there’s not currently a way to do precisely that.

Is there another reasonable way I could support calling `installcheck` without an explicit build step first?
