Configure Cmake Build - Error : Could NOT find Sphinx (missing: SPHINX_VERSION)
Closed, ResolvedPublic

Description

Cmake : 3.10.2
Linux : Ubuntu 18.04

Command

cmake ../ -G"Unix Makefiles" -DTARGET_PLATFORM=MUSCA_A -DCOMPILER=ARMCLANG

When following software requirements, and setting

It reports..

-- Could NOT find Sphinx (missing: SPHINX_VERSION) 
CMake Warning at cmake/Common/BuildSphinxDoc.cmake:59 (message):
  Some tools are missing for Sphinx document generation.  Document generation
  target is not created.
Call Stack (most recent call first):
  cmake/Common/BuildSphinxDoc.cmake:65 (SphinxFindTools)
  secure_fw/CMakeLists.txt:23 (include)

Although I see it being installed in: /usr/bin/sphinx-build and reports

~/trusted-firmware-m/cmake_build$ sphinx-build --version
Sphinx (sphinx-build) 1.6.7

Problem could be here, when it compares the string.

Newer versions of sphinx seem to print the version as:

$ sphinx-build.exe --version
sphinx-build 2.1.2

I think the ) character is making the reqexp on this line https://git.trustedfirmware.org/trusted-firmware-m.git/tree/cmake/FindSphinx.cmake#n85 fail to match.
Can you please check if changing line 85 like this helps?: if(_SPHINX_VERSION MATCHES ".*sphinx-build[^0-9.]*([0-9.]+).*")

CMake Error in cmake/FindSphinx.cmake:
  A logical block opening on line 84 is not closed.

Can you please double check you modification? Line 84-88 should be:

if(_SPHINX_VERSION)
        if(_SPHINX_VERSION MATCHES ".*sphinx-build[^0-9.]*([0-9.]+).*")
		string(REGEX REPLACE ".*sphinx-build ([0-9.]+).*" "\\1" SPHINX_VERSION "${_SPHINX_VERSION}")
	endif()
endif()

@gyuri-szing

The line sort outs

if(_SPHINX_VERSION MATCHES ".*sphinx-build[^0-9.]*([0-9.]+).*")

Thanks.

Can you please create a pull request with the fix?

gyuri-szing closed this task as Resolved.Wed, Aug 28, 11:42 AM
gyuri-szing claimed this task.

Fix was merged.