# Targets package and source\_package - created only when configured for Make or Ninja?

**URL:** https://discourse.cmake.org/t/targets-package-and-source-package-created-only-when-configured-for-make-or-ninja/620
**Category:** Usage
**Created:** [February 12, 2020, 1:05pm UTC](https://discourse.cmake.org/t/targets-package-and-source-package-created-only-when-configured-for-make-or-ninja/620 "2020-02-12T13:05:53Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![jwuttke](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/j/9dc877/32.png) [@jwuttke](https://discourse.cmake.org/u/jwuttke)
#### Post date: [February 12, 2020, 1:05pm UTC](https://discourse.cmake.org/t/targets-package-and-source-package-created-only-when-configured-for-make-or-ninja/620/1 "2020-02-12T13:05:53Z")

</div>

The CPack help page says: "Inclusion of the CPack module adds two new build targets, `package` and `package_source`". Craig Scott’s book says: these targets are only created if the project is configured for a Makefile or Ninja generator. Who is right? Should the help page be corrected?

This is related to my MR [https://gitlab.kitware.com/cmake/cmake/merge\_requests/4352](https://gitlab.kitware.com/cmake/cmake/merge_requests/4352).

---

<div class="post-metadata">

### Author: ![brad.king](https://discourse.cmake.org/user_avatar/discourse.cmake.org/brad.king/32/11_2.png) [@brad.king](https://discourse.cmake.org/u/brad.king)
#### Post date: [February 12, 2020, 2:23pm UTC](https://discourse.cmake.org/t/targets-package-and-source-package-created-only-when-configured-for-make-or-ninja/620/2 "2020-02-12T14:23:51Z")

</div>

Cc: @craig.scott

The Xcode generator also creates the `package` target. So does the VS generator, but it uses the upper-case name `PACKAGE`. It is correct that only the Ninja and Makefile generators create the `package_source` target.

---

<div class="post-metadata">

### Author: ![jwuttke](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/j/9dc877/32.png) [@jwuttke](https://discourse.cmake.org/u/jwuttke)
#### Post date: [February 12, 2020, 2:43pm UTC](https://discourse.cmake.org/t/targets-package-and-source-package-created-only-when-configured-for-make-or-ninja/620/3 "2020-02-12T14:43:33Z")

</div>

Thank you. I updated the MR accordingly.

---

<div class="post-metadata">

### Author: ![craig.scott](https://discourse.cmake.org/user_avatar/discourse.cmake.org/craig.scott/32/20_2.png) [@craig.scott](https://discourse.cmake.org/u/craig.scott)
#### Post date: [February 12, 2020, 8:48pm UTC](https://discourse.cmake.org/t/targets-package-and-source-package-created-only-when-configured-for-make-or-ninja/620/4 "2020-02-12T20:48:27Z")

</div>

> [@jwuttke](#):
>
> Craig Scott’s book says: these targets are only created if the project is configured for a Makefile or Ninja generator.

Checking again just now, I can only find text in the book that says this for the `package_source` target, not the main `package` target. If you could let me know which part of the book (edition and page number) you are referring to, that would be helpful. Please use the book’s website to report back on that though, this forum is for CMake and my book is a separate concern from things here.

> **[Contact](https://crascit.com/contact/)**
>
> For queries relating to Crascit products, consulting services, book errata, or the CMake snap packages, please get in contact via the email address below.
