Targets package and source_package - created only when configured for Make or Ninja?

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.

1 Like

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.

Thank you. I updated the MR accordingly.

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.

1 Like