[PATCH] Allow CMake to build Sphinx documentation

Sean Silva chisophugis at gmail.com
Thu Apr 17 11:55:56 PDT 2014


Sorry for the delay.

This is looking really good. I would like to remove the linkcheck target
just on the principle that the build should not go accessing external
websites.

Also, fixing those broken links is a "patches welcome" situation that many
new contributors will actually bite on. That's not an argument for not
fixing the links; it's an argument for not worrying too much about not
fixing them. Rather than fix trivial mechanical issues like broken links,
people that have more experience with LLVM would serve the community better
by actually contributing *content* <
http://llvm.org/docs/SphinxQuickstartTemplate.html> covering a specific
area that they know about.

You should send 0002 in a separate patch thread. I don't really have the
knowledge to sign off on it. I think you'll want to CC chapuni or chandler.

-- Sean Silva


On Wed, Apr 16, 2014 at 11:50 AM, Dan Liew <dan at su-root.co.uk> wrote:

> Okay here is my second attempt at this. Rather than explain the
> differences, here's how to use it
>
> Build with the following CMake options enabled
>
> LLVM_ENABLE_SPHINX
> LLVM_BUILD_DOCS
>
> This will enable and build by default the following targets
> docs-llvm-html, docs-llvm-man.
>
> If you run ``make install`` then the documentation will be installed
> in the followings locations
>
> HTML files are installed to
>
> ${CMAKE_INSTALL_PREFIX}/share/doc/${CMAKE_PROJECT_NAME}/html/
>
> Man pages are installed to
>
> ${CMAKE_INSTALL_PREFIX}/share/man/man1/
>
> These locations are correct for my particular Linux install but I'm
> not sure about OSX or Windows.
>
> I've put the add_sphinx_target() CMake function in a separate file so
> it can be included by other projects (e.g. Clang). It just needs to be
> called by CMakeLists.txt file within a directory containing Sphinx
> documentation.
>
> I've tested this with make and ninja under Linux and it seems to work fine.
>
> I've also attached a second patch that makes configure fail if
> LLVM_ENABLE_DOXYGEN was enabled but doxygen was not found.
>
> Thanks,
> Dan.
>
>
> On 16 April 2014 02:02, Dan Liew <dan at su-root.co.uk> wrote:
> >> Maybe it's because of the :program: tag?
> >
> > I think it's actually the docs/conf.py configuration file that
> > populates the man_pages [1] variable based on the contents of
> > docs/CommandGuide directory
> >
> > The program:: directive seems to tell sphinx that following option::
> > directives refer to that tool [2]
> >
> > [1] http://sphinx-doc.org/config.html#confval-man_pages
> > [2] http://sphinx-doc.org/domains.html#directive-program
> >
> > --
> > Dan Liew
> > PhD Student - Imperial College London
>
>
>
> --
> Dan Liew
> PhD Student - Imperial College London
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140417/ba7f28a6/attachment.html>


More information about the llvm-commits mailing list