Docs: Use CMake to build docs directly
> Would it make sense to remove the Makefile and use CMake directly to build the docs?
yes, such further enhancements are totally reasonable. I just wanted to do something relatively quick to get documentation building easily accessible from CMake. Would you like following up on this in subsequent PRs ?
(I'm wondering if we could have things not requiring a Unix environment so doc building is available from non-Cygwin Windows (provided folks have installed Doxygen, sphinx, etc.), but that would be more a stretch goal...)
Originally posted by @rouault in https://github.com/OSGeo/gdal/issues/9836#issuecomment-2091115198
This is a bit tricky because the docs include some .rst files (driver summaries) that are generated at build time by a Python script invoked by make. Since Sphinx requires all rst files to be under a single root, this would require us to copy/link the static rst files into the build directory (as is done for autotest). This could be avoided by building the driver summaries with a Sphinx extension instead of the standalone Python script, but it's not clear if this would reduce overall complexity.
Since Sphinx requires all
rstfiles to be under a single root, this would require us to copy/link the staticrstfiles into the build directory
although not super elegant, why not just forcing the working directory to be PROJECT_SOURCE_DIR/doc when running the script that generates the .rst file ?
Are there other cases where the build process writes to the tree for an out-of-tree build? I didn't want to be the first.
Are there other cases where the build process writes to the tree for an out-of-tree build?
can't think of any. Doc building not being a default build target, I wouldn't mind an exception
This is a bit tricky because the docs include some .rst files (driver summaries) that are generated at build time by a Python script invoked by make
We could also avoid this issue by generating the driver summaries using Sphinx instead of an external script.