[Haskell-cafe] Inject cabal version or VCS version as a CPP macro

Eugene Kirpichov ekirpichov at gmail.com
Wed Feb 22 09:16:57 CET 2012


I'd like my program to print something like "this is $program 1.0.4 git
45fea6b" when invoked with --version, or at least just the 1.0.4 part.

Can Cabal expose the version as a preprocessor macro by default, or do I
have to use Build-Type: Custom and add a preprocessing step of my own?

Eugene Kirpichov
Principal Engineer, Mirantis Inc. http://www.mirantis.com/
Editor, http://fprog.ru/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20120222/c7ac3fd2/attachment.htm>

More information about the Haskell-Cafe mailing list