You might want to define it conditionally, depending on version.Let's suppose that I do actually want to define __HADDOCK__ for my library.
Can I do this with a user-defined hook using the Cabal library?
Cabal supports package-version macros, and haddock installs both
a package (the paths are wrong in the package description, but you
can find the version number there) and an executable for itself, but the package version macros are not available in Setup.hs.
Still, you might find something useful in the discussion for this ticket:
Cabal should support Cabal-version-dependent Setup.hs
http://hackage.haskell.org/trac/hackage/ticket/326