Now your package is released, your local PID system can find and build any released version of your code. But for now no one except yourself can use it, what is not so interesting !

The package registering is the process that makes a package available for others. This basically consist in sharing specific cmake script files with others. For registering a package there are 2 types of files that must be shared:

  • find files, that are used to find packages versions in a local workspace. These file are creally common in CMake, they are used by the find_package command to get information about dependencies. find files in PID have a specific content AND they are fully automatically generated (no more need to bother to write find files) at build time.
  • reference files, that are used to find packages online. These files are specific to PID and contain information used to clone git repositories of packages and download their binary packages. These files are also automatically generated by PID, but using an explicit command.

These files, among other types of PID specific CMake files, are shared using contribution spaces.

Step 7: Using contribution spaces

A contribution space is a git repository that contains contributions files. These files are of many types but in this tutorial the only interesting files are find and reference files. Each contribution space that is used is cloned into the local workspace, in the contributions folder. There is a default contribution space called pid, it is the official contribution space and all contributions it contains are publicly available.

7.1 Structure of contribution space and registering process overview

A contribution space is a folder whose direct subfolders contain contributions files. There are 2 interesting subfolders:

  • finds that contains find files.
  • references that contains reference files.

Registering a package simply consists in:

  1. copying the files generated by this package into the corresponding folders of a given local contribution space.
  2. publish (push) the modifications made in the local contribution space to its remote repository.

Once done, anyone using this contribution space in its local workspace is capable of deploying the packages that it references without effort.

7.2 Using the official contribution space

In this tutorial, to keep it simple, we will use the official contribution space of pid. Except you are a developper of PID you cannot directly modify the content of the remote repository, and consequently you cannot publish your new content.

To solve the problem:

  1. fork pid-contributions project or any one of its mirrors in the git hosting service you are using. Let suppose the address of the git repository is with own the namespace where you forked the official repository.
  2. then change the publish remote of pid contribution space:
cd <pid-worskspace>
pid contributions cmd=churl space=pid

That’s it you can now register your package into official contribution space.

Step 8: Registering the package

The registering phase is achieved by using a dedicated PID command:

cd <pid-worskspace>
pid register package=my-first-package

This last command can be decomposed into two operations:

  • generating the find and reference files of the package (Findmy-first-package.cmake and Refermy-first-package.cmake) and putting them in adequate places of the contribution space in use (here the PID official one). This can be achieved manually by doing:
cd <my-first-package>
pid referencing

These files are finally located at <pid-worskspace>/contributions/pid/finds/Findmy-first-package.cmake and <pid-worskspace>/contributions/pid/references/Refermy-first-package.cmake.

  • publishing the content of the pid contribution space. This technically consists in comitting changes (two new files added in this situation) and pushing them to your fork repository of pid-contributions.This can be achieved manually by doing:
cd <pid-worskspace>
pid contributions cmd=publish space=pid

Have a look into your fork of pid-contributions, on the hosting service your are using. You should now see that a new commit has been generated and specifies that a references to my-first-package has been added/updated. But it is not already really part of official contribution space, since it is not part of the official pid-contributions repository.

To do so, you need to propose a merge request to official pid-contributions project for your contributions to be part of the official contributions of PID. Once your merge request is accepted by the administrator of the official pid-contributions repository, your package is registered and available to everyone ! Please do not do that for this tutorial package (merge request would be rejected anyway, this package being quite unuseful).

Now you know how to manage a package, let’s see how to manage many.