# Are the commands "cmake -build . --target package" and "cpack ." equivalent?

**URL:** <https://discourse.cmake.org/t/are-the-commands-cmake-build-target-package-and-cpack-equivalent/612>\
**Category:** Usage\
**Created:** [February 11, 2020, 12:14pm UTC](https://discourse.cmake.org/t/are-the-commands-cmake-build-target-package-and-cpack-equivalent/612 "2020-02-11T12:14:09Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![hex](https://discourse.cmake.org/user_avatar/discourse.cmake.org/hex/32/363_2.png) [@hex](https://discourse.cmake.org/u/hex)\
**Post date:** [February 12, 2020, 6:58am UTC](https://discourse.cmake.org/t/are-the-commands-cmake-build-target-package-and-cpack-equivalent/612/4 "2020-02-12T06:58:51Z")

</div>

Yes, `package` is a build-in target in CMake with dependeny to `ALL`.

I mentioned that here yesterday:

> [@Does the CPack IFW Generator always include the module CPackIFW?](https://discourse.cmake.org/t/does-the-cpack-ifw-generator-always-include-the-module-cpackifw/615/4):
>
> Package is automatically dependent on build, so even if you do not build your project and run `cmake --build . --target package` it is going to build your project first.

---

_[View the full topic](https://discourse.cmake.org/t/are-the-commands-cmake-build-target-package-and-cpack-equivalent/612)._
