How can my-program.hs get its version number from my-program.cabal at build time?

Posted by Dave Hinton on Stack Overflow See other posts from Stack Overflow or by Dave Hinton
Published on 2010-05-23T16:47:30Z Indexed on 2010/05/23 16:50 UTC
Read the original article Hit count: 288

Filed under:
|
|
|

I would like my cabalised program to have a --version switch.

I would like it to report the same version as is present in the .cabal file.

If I have to update the version number separately in my Haskell source code as well as in the .cabal file, I will eventually get them out of sync.

So, how can my program, while being compiled under cabal, get its version number from the .cabal file?

© Stack Overflow or respective owner

Related posts about haskell

Related posts about version