Adding third party libraries to dist (part 1)
A guide on how to add a third-party library in the dist.
Third Party libraries are libraries whose code is not developed by ESSS. We call these libraries shared-resources because they are shared amongst the projects.
The group of libraries that work well together are organized in a toolchain, that is, a list of shared-resource versions compatible with each other. The toolchains are named after the dist project, which organizes these different libraries together building a "dist", or distribution.
This article provides a guideline on how to add new libraries to the distribution, from the initial tests with the library to the integration of the build process.
Considerations
As a rule, third-party code should not be included in the "projects-repository". That means that code that is not developed by ESSS should not be incorporated in the ESSS projects. The right place for these libraries is the "shared-repository", where both the source-code and binary code for the various platforms are stored. The shared-repository is source of the libraries downloaded by the famous builds command bb update.download.
This separation make possible to update the third-party library without having to change the project that uses. Beyond that, other applications can use the trird-party library without having to depend on the project that originally added it to the dist.
Initial Tests
The first step towards the incorporation of a new library in the distribution is to test it by using it. Once the library is found the user should compile and organize it locally as if it were already in the distribution, that means:
1. The library must be placed in the "Shared" directory
The name of the directory must use the naming stardard for the shared-resources, that is: the name is lowercase and the library version separated by a hipen:
Examples:
* e:\Shared\dist-0707\i686.win32\boost-1.34.0
* e:\Shared\dist-0707\i686.win32\pywin32-211
* e:\Shared\dist-0707\i686.win32\jpeg-6b
Note that the version format follows the original version standard adopted by the third-party library.
2. The library directories
Try to follow the original directory organization. If there is no suitable organization, or the original organization is too messy, make sure to include the following directories:
* /include Place for the C++ include files
* /bin Place for executables and DLLs
* /lib Place for the libraries (not the DLLs)
* /python Place the python code here
3. The project that uses the library must include it using a shared-script.
The shared-script is a python script that holds all the information about a given shared-resource or project. In order to use the third-party library you must create a shared-script for it. Initially place the script in the /build/SharedScript folder of your project. Later the shared-script will be incorporated in the Builds' shared-scripts.
The following template can be used for the library shared-script. It is declared for a library "mylib" with the version "0.1".
Note that the file must be named after the library, in this case, "mylib.py".




Leave a comment