Moved Sphinx detection outside of the PYTHONINTERP_FOUND block.
authorRoman Donchenko <roman.donchenko@itseez.com>
Fri, 23 Aug 2013 14:43:06 +0000 (18:43 +0400)
committerRoman Donchenko <roman.donchenko@itseez.com>
Fri, 23 Aug 2013 14:48:08 +0000 (18:48 +0400)
Who knows, maybe the user's Sphinx installation uses a Python we couldn't find.

cmake/OpenCVDetectPython.cmake

index 8630a82..65c45c9 100644 (file)
@@ -74,19 +74,19 @@ if(PYTHONINTERP_FOUND)
                       OUTPUT_STRIP_TRAILING_WHITESPACE)
     endif()
   endif(NOT ANDROID AND NOT IOS)
-
-  if(BUILD_DOCS)
-    find_host_program(SPHINX_BUILD sphinx-build)
-    if(SPHINX_BUILD)
-        execute_process(COMMAND "${SPHINX_BUILD}"
-                        OUTPUT_QUIET
-                        ERROR_VARIABLE SPHINX_OUTPUT
-                        OUTPUT_STRIP_TRAILING_WHITESPACE)
-        if(SPHINX_OUTPUT MATCHES "Sphinx v([0-9][^ \n]*)")
-          set(SPHINX_VERSION "${CMAKE_MATCH_1}")
-          set(HAVE_SPHINX 1)
-          message(STATUS "Found Sphinx ${SPHINX_VERSION}: ${SPHINX_BUILD}")
-        endif()
-    endif()
-  endif(BUILD_DOCS)
 endif()
+
+if(BUILD_DOCS)
+  find_host_program(SPHINX_BUILD sphinx-build)
+  if(SPHINX_BUILD)
+      execute_process(COMMAND "${SPHINX_BUILD}"
+                      OUTPUT_QUIET
+                      ERROR_VARIABLE SPHINX_OUTPUT
+                      OUTPUT_STRIP_TRAILING_WHITESPACE)
+      if(SPHINX_OUTPUT MATCHES "Sphinx v([0-9][^ \n]*)")
+        set(SPHINX_VERSION "${CMAKE_MATCH_1}")
+        set(HAVE_SPHINX 1)
+        message(STATUS "Found Sphinx ${SPHINX_VERSION}: ${SPHINX_BUILD}")
+      endif()
+  endif()
+endif(BUILD_DOCS)