yade.libVersions module

The yade.libVersions module tracks versions of all libraries it was compiled with. Example usage is as follows:

from yade.libVersions import *
if(getVersion('cgal') > (4,9,0)):
        
else:
        

To obtain a list of all libraries use the function libVersions.printAllVersions.

All libraries listed in prerequisites are detected by this module.

Note

If we need a version of some library not listed in prerequisites, then it must also be added to that list.

When adding a new version please have a look at these three files:

  1. py/_libVersions.cpp: detection of versions from #include files by C++.

  2. py/libVersions.py.in: python module which is constructed by cmake during compilation. All *.in files are processed by cmake.

  3. cMake/FindMissingVersions.cmake: forced detection of library with undetectable version.

Hint

The safest way to compare versions is to use builtin python tuple comparison e.g. if(cgalVer > (4,9,0) and cgalVer < (5,1,1)):.