dannyedel / dspdfviewer

Dual-Screen PDF Viewer for latex-beamer
http://dspdfviewer.danny-edel.de
GNU General Public License v2.0
218 stars 27 forks source link

Rework version number embedding logic #50

Closed dannyedel closed 9 years ago

dannyedel commented 9 years ago

Rather than failing the build when it can't determine a version number, the build system should have a fallback (which should probably be something like vNEXT-rc, so bug reports built from that build system can be identified).

Any system-specific versionings (like debians changelog) should be parsed in the system-specific build instruction, and the result passed as environment variable or similar. cmake can then check its presense.

Order or precedence (First one that produces a non-empty string wins)

  1. cmake -DDSPDFVIEWER_VERSION=1.2.3.4
  2. If the directory .git exists, run git describe
  3. System specific, given in environment variable
  4. fallback version number, in CMakeLists.txt.
    • Update this on a release tag to the current version number, and immediatly after to "something higher".

The fallback mechanic can be tested by doing something along the lines of

TEMPDIR=$(mktemp -d)
git archive HEAD | tar -C $TEMPDIR -x && \
cd $TEMPDIR && \
mkdir build && \
cd build && \
cmake .. && \
make
dannyedel commented 9 years ago

Builds from non-release non-git will show vNEXT-rc0 from now on, this should make them easy to detect.