Fix build when DOCS option is off.
The build failed if py-sphinx was not installed as it always ran
post-build and post-install targets.
This patch also moves OPTIONS_DEFINE further down (as suggested by portlint).
PR: 246643
Submitted by: Robert Kruus <robert.kruus@utoronto.ca>