TriBITS
TriBITS copied to clipboard
version checking for TPLs
Most packages not only depend on a TPL, but a certain version or version range thereof. TriBITS needs to support version checking and specification for TPLs.
@jwillenbring, you should be aware of this github issue.
Just happened to stumble on this and thought I would document this here.
Note that even CMake 3.0 documentation for FIND_PACKAGE() admits:
Many find-modules provide limited or no support for versioning; check the module documentation.
This will be a hard problem to address.
That's absolutely right: We cannot address the problem globally.
What we can do, however, is to try and check the version of TPL if a package requests it, and return an error if the check didn't succeed ("Cannot determine the version of ${TPL}."). That said, for many TPLs, version checking is a matter of grepping around a *_version.h header; it shouldn't be too hard to do.