openmicroscopy/openmicroscopy — pull request #2934 by rleigh-dundee (2014-08-11 22:03:17+00:00)
Title: cmake: Add versioning of build, library and installation metadata

The existing cmake support simply provided and equivalent build to scons, but there are still several deficiencies, notably library versioning and a usable installation with cmake support. This further develops the cmake support to include simple library versioning and cmake `find_package` support

- git release commit and release date are embedded in the existing gitversion.xml source metadata
- additionally generate GitVersion.cmake in the source zip
- cmake versioning adapted from the existing Bio-Formats cmake versioning
- omero-client library is versioned
- omero-client cmake metadata generated and installed

--------

Testing:

With this PR merged in
- run `./build.py version-info`
- run `git tag -m 'test release' v.5.1.0-m2`
- run `./build.py version-info`
- run `./build.py release-src`
- unzip the target/openmicroscopy-5.1.0-m2.zip source release outside the git source tree e.g. in /tmp
- `cd` into the unpacked source release
- run `./build.py version-info`; this should match what you saw earlier after tagging
- make a temporary build directory e.g. /tmp/build and `cd` into it
- run `cmake /path/to/source/release`; the cmake output should include `-- Configuring openmicroscopy version 5.1.0-m2` near the top
- run `make [-jn]`
- run `make DESTDIR=/tmp/install` install
- look in `/tmp/install/usr/local/lib`; libomero-client should have the release version number and `cmake/omero-client-config.cmake` should include all the correct version metadata as well as hints for the installed locations of the omero client headers and library.

(End users can use `find_library(omero-client 5.1.0)` to build against the installed omero client.)