Searching up from the conf.py only works if it is inside the repository
and not for out-of-tree builds (because conf.py gets configured in the
build directory).
If git is not available (and it doesn't have to be when building from a
source archive) building the documentation fails because we use
`git rev-parse` to determine whether a certain version is unreleased.
We now use the version.txt file to do this check
This uses the packaging library, but this should not introduce a new
dependency because sphinx depends on setuptools which also depends on
that library.
Fixes#2309
rtd scans the project for a conf.py file so we cannot name it conf.py.in
unless we get rtd to run cmake before building.
The easier option is to have doc/conf.py be the file used by rtd and all
other builds use cmake to first configure it.
This also moves the doc generation completely into cmake (no more
Makefile).
To generate the docs the project needs to first be configured and then
`make doc` can be run.
The approach used is leaned on the cmake's project own use of Sphinx:
Utilities/Sphinx/CMakeLists.txt
This allows us to also have the manual as part of the generated html
documentation.
The syntax is also easier to use.
Right now the man page installed on the system is not replaced with the
rst file, this will come in a later step