Fix pygments detection for sphinx for docs build
authorMark Abraham <mark.j.abraham@gmail.com>
Wed, 12 Jun 2019 15:39:08 +0000 (17:39 +0200)
committerMark Abraham <mark.j.abraham@gmail.com>
Wed, 12 Jun 2019 21:13:48 +0000 (23:13 +0200)
Got broken in 29616660 but somehow wasn't a problem in the docs build
on the dedicated slave for that.

Refs #2615

Change-Id: I407383bd0342decae56e4c60202ffbf190e8bb1b

cmake/FindSphinx.cmake

index 5d078495dcf9d8a66f72f8bc967b3c2c98f1a7af..24ce316f6e9ca735b3500ade0f6e13ab587c9d25 100644 (file)
@@ -69,11 +69,13 @@ set(_find_deps_options)
 if (Sphinx_FIND_QUIETLY)
     set(_find_deps_options QUIET)
 endif()
+
+# Check if pygments module is available via the Unix error code (ie. 0
+# for success)
 execute_process(COMMAND "${PYTHON_EXECUTABLE}" "-c"
                 "import pygments"
-                RESULT_VARIABLE _pygments_status
-                ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
-if (_pygments_status)
+                RESULT_VARIABLE _pygments_status)
+if (_pygments_status EQUAL 0)
     set(Sphinx_pygments_FOUND 1)
 endif()