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_packagecommand 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:
findsthat contains find files.
referencesthat contains reference files.
Registering a package simply consists in:
- copying the files generated by this package into the corresponding folders of a given local contribution space.
- 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:
- 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
ownthe namespace where you forked the official repository.
- then change the publish remote of
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:
This last command can be decomposed into two operations:
- generating the find and reference files of the package (
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:
These files are finally located at
- publishing the content of the
pidcontribution 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:
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
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.