Ask Your Question

Unable to build documentation [closed]

asked 2013-02-21 10:09:34 -0500

kebs gravatar image

updated 2013-02-21 10:10:37 -0500

I have successfully build Opencv2.4.4, with:


Now, a couple of days later, I want to build documentation for offline reading. After rerunning cmake, I notice the following output:

--   Documentation:
--     Build Documentation:         NO
--     Sphinx:                      NO
--     PdfLaTeX compiler:           /usr/bin/pdflatex

I couldn't find anywhere a list of valid options for cmake, so I had a look inside the file CMakeLists.txt, where I notice that the corresponding option seems to be called BUILD_DOCS.

So I try again cmake:


or even:


But, no, the cmake output keeps saying it won't build doc. And funnily , it seems that this option should be enabled by default (line 154) :

OCV_OPTION(BUILD_DOCS "Create build rules for OpenCV Documentation" ON )

However, after checking indepth the Cmakelists.txt file (line 807), it seems that is is indeed possible to build html and pdf versions of doc ?

So my questions are:

  • Is is possible to build doc without Sphinx ?
  • If yes, how can I force cmake to generate the "doc" target ?

(And, yes, in the meanwhile I got the online pdf files, but the question remains.)

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by sturkmen
close date 2020-09-26 07:36:22.673630

2 answers

Sort by ยป oldest newest most voted

answered 2013-02-21 10:37:43 -0500

updated 2013-05-27 03:17:15 -0500

Abid Rahman K gravatar image

You need to install Sphinx. It is main tool for building docs. Also, documentation is not included to all target of make. You need make docs to build documentation in pdf format and make html_docs to build html documentation same as on If you want to build pdf some additional font packages are needed also.

edit flag offensive delete link more


Thanks, that's a clear answer, although it is to me contradictory with CMakeLists.txt:835, that states: "status("Build Documentation:" PDFLATEX_COMPILER THEN YES ELSE "YES (only HTML and without math expressions)")". As I have the latex compiler, I expected it to say "YES", thus my incomprehension. But maybe that was just something that was planned and that eventually didn't work. (I'm not very good with cmake)

kebs gravatar imagekebs ( 2013-02-22 04:35:22 -0500 )edit

+1 - make docs is mentioned no where, I think. Thank you.

Abid Rahman K gravatar imageAbid Rahman K ( 2013-05-27 03:03:00 -0500 )edit

Even after installing sphinx, the doc build will not work after a new cmake. There is a problem in cmake/OpenCVDetectPython.cmake. The line

if(SPHINX_OUTPUT MATCHES "^Sphinx v([0-9][^ \n]*)")

does not work correctly. Only if I force SPHINX_VERSION to 1.2 (my version) the documentation will built (both HTML and PDF).

The problem is related to executing sphinx-build, which returns a multi-line response, which includes the Sphinx version as the second line. I guess the MATCHES statement does not handle that correctly (I am not a cmake expert, though).

I am using the git procedure to build from source (2.4).

ggl gravatar imageggl ( 2013-07-02 04:29:32 -0500 )edit

I recommend you to create a ticket on OpenCV issue tracker ( Also, if you know appropriate solution, you can contribute it via pull request on Github. Contributor instruction are published in wiki on issue tracker.

Alexander Smorkalov gravatar imageAlexander Smorkalov ( 2013-07-09 08:25:35 -0500 )edit

if you are on MAC OS X using BREW consider this for sphinx:

nkint gravatar imagenkint ( 2014-01-29 03:07:23 -0500 )edit

make html_docs make many html documents but make install don't install it . what html docs are important to belongs to an rpm package ?

sergiomb gravatar imagesergiomb ( 2015-07-14 17:11:09 -0500 )edit

answered 2013-08-21 01:05:33 -0500

Damilola gravatar image

updated 2013-08-21 01:10:23 -0500

After installing sphinx, open cmake/OpenCVDetectPython.cmake and replace line if(SPHINX_OUTPUT MATCHES "^Sphinx v([0-9][^ \n])") With if(SPHINX_OUTPUT MATCHES "Sphinx v([0-9][^ \n])") and it would work perfectly

edit flag offensive delete link more


Hi I'm using opencv 2.4.9 with VS 2012.I just installed to my computer but when making an installation,it said that i don't have python version 2.7! I need to download python version 2.7 and this problem will be solved?? I am very new to opencv and i need a lot of help!!

littleduck gravatar imagelittleduck ( 2014-12-24 14:20:24 -0500 )edit

Question Tools

1 follower


Asked: 2013-02-21 10:09:34 -0500

Seen: 4,206 times

Last updated: Aug 21 '13